0
votes

I'm using a storyboard based setup and have a UINavigationController that tracks a set of UIViewControllers as they do... i have a single main UIViewController that acts as a "home screen' and all activities and tasks branch off from there.

As things stand, under certain scenarios I pop to the root view controller and some scenarios I actually have a segue that points back to that root "home screen" view controller.

I've been seeing some crashes pop up when i land back on the home view controller and then go to segue away from there again... the error is

Could not find a navigation controller for segue 'xxx'. Push segues can only be used when the source controller is managed by an instance of UINavigationController.

...could this occur because of the cyclical nature of my storyboard? is it okay that I have these segues going back to the home view controller? does this create another instance of the home view controller? should i just always pop to root instead?

1
I hope this will helps u and resolve your issue [Unwind Segue][1] [1]: stackoverflow.com/questions/12561735/…Satish Azad

1 Answers

1
votes

No, it's not OK to "go back" to any controller with a segue (other than an unwind) because, yes, it does create a new instance. If you want to go back you have to use an unwind segue, or popToRootViewController (or any of the other pop methods) in a navigation controller based app.