I'm creating my managedObjectContext in GameAppDelegate and passing it to my first ViewController (GameViewController) which isn't embedded in a UINavigationController, i want to pass then my managedObjectContext to my next view which is embedded in a navigationController. this is what i tryed to do so far in my prepareForSegue
:
UINavigationController *navController =(UINavigationController *)segue.destinationViewController;
((PickTypeViewController *)navController.viewControllers[0]).managedObjectContext=managedObjectContext;
but then I get the following error:
Game[17878:c07] Uncaught exception: Could not find a navigation controller for segue 'Play'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.
why is this happening