Last active
August 29, 2015 14:08
-
-
Save danmiser/9894a60b8f43f0401265 to your computer and use it in GitHub Desktop.
MonoTouch iOS8 not calling LoadView
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Recreate the home screen menu in case things have changed since the last sync | |
AppDelegate delegateReference = (AppDelegate)UIApplication.SharedApplication.Delegate; | |
// This if should always be true. Just being defensive to prevent crash shutdown if it's not | |
var viewControllers = delegateReference.rootNavigationController.ViewControllers; | |
if (viewControllers != null && viewControllers[0] is HomeScreen) | |
{ | |
var homeScreen = (HomeScreen)viewControllers[0]; | |
homeScreen.Root = homeScreen.CreateRoot(); | |
// This line of code is needed in iOS8. It ends up triggering LoadView() | |
// Without it, the Reload will end up with a null TableView and crash | |
var view = homeScreen.View; | |
homeScreen.Root.Reload(homeScreen.rootSection, UITableViewRowAnimation.None); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment