I\'ve got a UINavigationController
with a series of UIViewControllers
on it. Under some circumstances, I want to pop back exactly two levels. I thoug
It works for me if you save the reference to the UINavigationViewController
and use the saved instance:
UINavigationViewController* savedUinvc = self.navigationController;
UIViewController* one = [savedUinvc popViewControllerAnimated:YES];
if (...) {
// pop twice if we were doing XYZ
UIViewController *two = [savedUinvc popViewControllerAnimated:YES];
// stored in "one" and "two" for debugging, "two" is always 0 here.
}