I recently developed a CoreData application using the standard NavigationController-based template. This worked fine.
However, I now need to change the primary navigation model to a TabBar application...with the previous NavigationController driven app being one of several applications accessible through the TabBar items.
Since the standard template for a TabBarController application doesn't include an option for "Using CoreData", I had to figure out how to configure this on my own.
I figured out how to replace the primary navigation model of the previous app with a TabBar navigation model. That all works fine.
However, I'm not sure how to pass the ManagedObjectContext to each of the TabVarViewControllers.
In the previous NavigationController app this was done in the "awakeFromNib" method of AppDelegate.m using the following code:
Code:
RootViewController *rootViewController = (RootViewController *)[self.navigationController topViewController];
rootViewController.managedObjectContext = self.managedObjectContext;
However, in the TabBar navigation model the code:
Code:
(RootViewController *)[self.navigationController topViewController]
is no longer applicable.
So, how to I pass the managedObjectContext to each of the respective TabBarViewControllers?
Any help would be greatly appreciated.
T.D. MIller