0

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?

MrTristan
  • 730
  • 5
  • 16
  • 1
    I hope this will helps u and resolve your issue [Unwind Segue][1] [1]: http://stackoverflow.com/questions/12561735/what-are-unwind-segues-for-and-how-to-use-them – Satish Azad Nov 15 '13 at 05:51

1 Answers1

1

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.

rdelmar
  • 102,832
  • 11
  • 203
  • 218
  • thanks for the clarification. in retrospect it seems obvious but for whatever reason i've gotten this far with these bad practices in place... :-) – MrTristan Nov 15 '13 at 15:41