I am just wondering how I could programmatically navigate around a navigationController stack?
I am familiar with the method:
[self.navigationController popToRootViewControllerAnimated:YES];
as well as:
[self.navigationController popViewControllerAnimated:YES];
But could programatically go to ANY view controller in my navigation controller?
Please see my pic:
http://s18.postimage.org/iq1l4f721/test_xcodeproj_Main_Storyboard_storyboard.jpg?
I know I can segue to any view using the storyboard but am I right in thinking this would keep pushing new views onto the stack and eventually (in theory) I would run into problems?
Thanks
Carl.
Yes , if you know the index of the controller in the stack or if you have a reference to it.
Like this:
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:index] animated:TRUE];Cheers!