iOS: How to tell when an app is going to suspend?
You can also add Notification observer
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receiveSuspendNotification:)
name:UIApplicationWillResignActiveNotification
object:nil];
- (void) receiveSuspendNotification:(NSNotification*)notif
{
}
method will get called and you can perform the required tasks.