[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillResignActive:)
name:UIApplicationWillResignActiveNotification object:nil]; //監(jiān)聽是否觸發(fā)home鍵掛起程序.
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:)
name:UIApplicationDidBecomeActiveNotification object:nil]; //監(jiān)聽是否重新進入程序程序.
- (void)applicationWillResignActive:(NSNotification *)notification
{
printf("按理說是觸發(fā)home按下\n");
}
- (void)applicationDidBecomeActive:(NSNotification *)notification
{
printf("按理說是重新進來后響應\n");
[NSTimer scheduledTimerWithTimeInterval:10.0f target:self selector:@selector(dismissKeyHUD) userInfo:nil repeats:NO];
}