Get NSManagedObjectContext when using Storyboard?

I don't know if this is what you need, but it may help: id appDelegate = (id)UIApplication sharedApplication delegate; self. ManagedObjectContext = appDelegate managedObjectContext.

Up vote 3 down vote favorite 2 share g+ share fb share tw.

The objective is to get the current NSManagedObjectContext in order to work with Core Data. In iOS 4.3 I set the UINavigationController's delegate to be the AppDelegate like so (in AppDelegate. M): self.

NavigationController. Delegate = self; and I could do something like this (wherever I needed the context): NSManagedObjectContext *context = self. NavigationController.

Delegate performSelector:@selector(managedObjectContext); Now, in iOS 5, I am using a Storyboard and I'm having a difficult time figuring out how to achieve this. I used a delegate in the first place because I don't think you want to be passing your AppDelegate. H around all the time.

Objective-c delegates storyboard nsmanagedobjectcontext link|improve this question asked Oct 17 '11 at 21:12mmvie13218 81% accept rate.

Perfect, thanks! – mmvie Oct 19 '11 at 14:19 Dude, many thanks! – Farini Nov 27 '11 at 23:53 I guess I spent way too much time trying to figure out how to pass the managedObjectContext from the app delegate to the view, of course a better solution is just to get the moc from the appdelegate.

Awesome! – Farini Nov 28 '11 at 0:00.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions