IOS newb struggling with core data. The Xcode sample project puts core data in app delegate. Then in the app delegate.m file, within the application didFinishLaunchingWithOptions: method it includes a call to the core data files: controller.managedObjectContext = self.managedObjectContext; which fires up the managedobjectcontext in the main controller.
I have read, however, that the app delegate file is not really where you should put the core data stuff but rather you should put it in a model file and call it as a singleton.
My problem is if you move it out of the app delegate file into a file with no application didFinishLaunchingWithOptions: method, how do you make sure the managed object context is available where you need it i.e. in other view controllers? In other words if all the core data stuff is in the model file, what is the correct syntax to invoke it from a controller file or alternatively makes it available to controller files from model file.
This problem has been driving me crazy for two weeks so would greatly appreciate any suggestions.