Navigation Bar Back Button Pop View Controller
When hitting the Back button on a navigation controller, does the view get popped off the stack? If so, how can I test that or make sure that it does it correctly (in other wo开发者_高级运维rds, created a proper navigation controller)?
I need to see if the view is actually getting popped. Is there anything I can NSLog
that shows me the stack or something?
Thanks,
Yes, the view is popped from the stack. You can check the size of the stack (number of views) to confirm this.
The viewController is getting popped from the stack yes. You can also NSLog(@"%@", self.navigationController.viewControllers);
in - (void)viewWillAppear
and - (void)viewDidAppear
methods of the parent viewController to see the differences if you don't trust that Apple engineers did a good job with it.
NSLog(@"%@", self.navigationController.viewControllers);
would give the viewcontrollers array in navigation stack.you can nslog them before the view disappears and after the other view appears
精彩评论