To do what you requested, look at the UINavigationControllerDelegate protocol, namely the method:
- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated
when the viewController argument is no longer your view controller, you must save it.
However, executing this function viewWillDisappear: might be a better (and much simpler) idea.
Benjie Oct 31 '11 at 2:00 a.m. 2011-10-31 02:00
source share