I used the default template provided by Apple with the underlying data (managedObjectContext is in AppDelegate). At first I included appdelegate.h in every class that I need to use managedObjectContext, but I saw that this is not the right way to do this. Apple says it's best to pass context to other classes that need it, and so on, so I ended it up like this. The fact is that it looks a bit βhackyβ as I did, and I wonder if there is a better option or my decision is correct.
Currently, my application is configured like this (here is the SS of my storyboard): 
So my root window is a UITabBarController, and each tab is a UINavigationController, which points to several UITableViewController / UIViewController.
Here is what I have in my Appdelegate to pass the managedObjectContext instance to 2 tabs:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UITabBarController *rootViewController; UINavigationController *navigationController; ItemsTableViewController *itemsTableViewController;
Everything works well, but you need to call objectAtIndex several times to get the right ViewController looks meh ...
Anyone like a better solution?
Thanks!
source share