smparkes suggestion is right. You could register for UIApplicationDidBecomeActiveNotification
or UIApplicationWillEnterForegroundNotification
. These notifications are called after those method (the ones smparkes wrote) are called. In the handler for this notification do what you want. For example in viewDidLoad
for your controller register the following notification:
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(doUpdate:)
name:UIApplicationDidBecomeActiveNotification object:nil];
Do not forget to remove in dealloc
:
[[NSNotificationCenter defaultCenter] removeObserver:self];
Finally, doUpdate
method could be the following
-(void)doUpdate:(NSNotification*)note
{
// do your stuff here...
}
I suggest you to read UIApplicationDelegate class reference. In particular read about Monitoring Application State Changes.
Hope it helps.