Skip to content

Instantly share code, notes, and snippets.

@romyilano
Created February 1, 2014 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romyilano/8755258 to your computer and use it in GitHub Desktop.
Save romyilano/8755258 to your computer and use it in GitHub Desktop.
grab a reference to the initial view controller while launching with a storyboard
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
MasterViewController *controller = (MasterViewController *)navigationController.topViewController;
controller.managedObjectContext = self.managedObjectContext;
return YES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment