I have two tabs. Tab 1 and Tab2.
In tab2 I have a table view controller displaying a table. The table view controller is inside a navigationcontroller. I am using storyboard.
I need to pass my managedObjectContext to the second tab so that I can display the data in the table.
This is what I have so far but it seems quite rigid. How do I pass the context without getting it from the delegate? So far I have this but if I understand correctly, I need to pass the context to svc from fcv and not directly in the delegate.
FirstViewController *fvc = (FirstViewController *)[tabBarController.viewControllers objectAtIndex:0];
SecondViewController *svc = (SecondViewController *)[tabBarController.viewControllers objectAtIndex:1];
fvc.managedObjectContext = self.managedObjectContext;
svc.managedObjectContext = self.managedObjectContext;
Okay
expose the pertinent core data objects in your app delegate
In both your FirstViewController and SecondViewController you then access the moc (and the other stuff if you need to) as above (Marko’s answer) except mod is shown….