I'm trying to attach my MOC to a UITableViewController
that has been created using Xcode 5 Storyboards. The nesting is like this: UITabBarController
-> UINavigationController
-> UITableView
. I'm instantiating the MOC in the AppDelegate
and I want to pass it to the UITableView
. Any suggestions?
Thanks!
Thanks, the CoreDataBooks example does something like this: But their Storyboard is directly from UINavigationController -> UITableView.
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
RootViewController *rootViewController = (RootViewController *)[[navigationController viewControllers] objectAtIndex:0];
rootViewController.managedObjectContext = self.managedObjectContext;
I guess I can use method #1 below but what's the proper way to identify the UITabBarController from AppDelegate? I guess I need to instantiate that as its own class and import that into the delegate too?