HI
How can I detect when I return to a view? I have an iPad app in development and I want to do something upon returning to a certain view. How can I do this?
Thanks.
HI
How can I detect when I return to a view? I have an iPad app in development and I want to do something upon returning to a certain view. How can I do this?
Thanks.
If you're using UITabBarController you can take a look at UITabBarControllerDelegate protocol:
– tabBarController:didSelectViewController:
If you're using UINavigationController then the corresponding delegate protocol is UINavigationControllerDelegate and the method:
– navigationController:didShowViewController:animated:
Override the -viewWillAppear:
or -viewDidAppear:
method in the UIViewController subclass that manages the view. For example:
@implementation MyController
- (void)viewDidAppear:(BOOL)animated
{
// Do whatever you like here, for example...
[self setSomeBOOL:YES];
// Call super (per Apple's documentation).
[super viewDidAppear:animated];
}
@end