I’m working on a navigation based app, and I chose it so that I can push and pop controllers on and off the stack. It’s easy enough to move forward – just push a new controller. And moving back is easy as long as you go to the root view controller. There is a method called popToViewController:animated, but I didn’t create the controller I want to pop to from within my current view controller, so the compiler complains that I haven’t declared it. I know it’s the second controller on the stack (one above the root). Can I use that to get there?
I’m working on a navigation based app, and I chose it so that I
Share
The viewControllers property of a UINavigationController has the viewControllers in order that they were pushed, so you can use that and your knowledge of which view controller it is to pop to that view controller..here is a reference UINavigationController ref