Dear All, I am trying to build a navigation based iPhone application where I want to use Core Data modal at 3rd level view of navigation. The 1st and 2nd level view of this application are just simple tableViews. I have looked at the Apple CoreDataBooks application but there it used the methods for Core Data in the AppDelegate and RootViewController while I want to use these methods somewhere else. It is possible? Can somebody refer me to some tutorial for that? Thank you very much.
+1
A:
You can
- Have your view controller create the Core Data stack.
- Use
[[UIApplication sharedApplication] delegate]
to find the app delegate from anywhere, and ask it for a context. - Pass your context as an argument down through the view controllers.
It's a choice only you can make, based on the ways you expect your application to change in the future.
David M.
2010-09-09 21:17:34