The -popToViewController
is used to pop view controllers OFF the stack, down to one that already exists. Your NavigationView
has a stack of ViewControllers
(in the viewControllers
property), when you popToViewController
, you're going to want to pass one of the elements in that array as the first argument.
What you most likely want to do in this case is use -popViewControllerAnimated:
, which will remove the top ViewController
from the stack