I am trying to send my managedObjectContext from my masterViewController to anotherController via a segue and I am always getting this error:
-[UINavigationController setManagedObjectContext:]: unrecognized selector sent to instance 0x8d67c70
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationController setManagedObjectContext:]: unrecognized selector sent to instance 0x8d67c70'
I am getting the managedObjectContext from my appDelegate in the viewDidLoad()
of the masterViewController like this:
AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
self.managedObjectContext = appDelegate.managedObjectContext;
I cant possibly think of anything I could have done wrong anymore, please help.
I'm guessing that the view controller with the managedObjectContext property is embedded in a navigation controller. In the segue method, make sure you grab a reference to the correct view controller: