Quote:
Originally Posted by nobre84
I've ran into this some times. Its the animation. Until the first pop finishes you can't pop again or the nav bar buttons will bug on you. Change the second pop to viewDidAppear and see if it helps. This way it will pop back and pop again one animation at a time.
If you need to pop straight to the right controller you can try
Code:
int count = [self.navigationController.viewControllers count];
[self.navigationController popToViewController:[self.navigationController.viewControllers objectAtIndex:count-2]];
|
Keep in mind that
Code:
[self.navigationControllers.viewControllers count]
will return a number that is one more than the index for the current view. If you're popping multiple controllers, you will want to subtract one plus the number of controllers your moving back.
Another way, which might be more inelegant (but it works) is to assign a pointer to the navigation controller, then call popViewController:animated twice:
For example:
Code:
UINavigationController *navController = self.navigationController;
[navController popViewControllerAnimated:NO];
[navController popViewControllerAnimated:YES];