1
votes

I'm working on an iPad app that presents a smaller view which slides out from the side of the window. I need this view to run independently from the rest of the app, and I need it to have it's own navigation controller so segues can be performed in it's table views. Presenting this view is not the issue. The problem I'm having is that I cannot figure out how to set the UINavigationController to have a root view of this smaller view.

I present this view by adding it's view controller as a child view with addChildViewController: and then move it to the parent view (the presenting view controller).

I've created the small view controller in my storyboard, and then load the view controller by it's identifier. Here is the relevant portion of the storyboard...

enter image description here

The view loads without issue, but when I select a cell that in turn calls [self performSegueWithIdentifier:gameIdentifier sender:self];, I get the following error

Terminating app due to uncaught exception 'NSGenericException', reason: 'Could not find a navigation controller for segue 'Trivia'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.'

I've tried embedding the view in a Navigation Controller in the storyboard, but had the same result.

I'd be happy to provide any clarification or additional details. Any suggestions are much appreciated! Thanks!

1

1 Answers

1
votes

You need to embed the "Games Award View" in a navigation controller, and then when you're calling addChildViewController:, pass the navigation controller as the argument, not the Games view.