[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:)
name:UIApplicationWillTerminateNotification object:nil]; //監聽是否觸發home鍵掛起程序.
實現方法
- (void)applicationWillTerminate:(NSNotification *)notification
{
NSLog(@"按理說是觸發home按下\n");
}