//杀掉进程
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(onTerminate)
name:UIApplicationWillTerminateNotification
object:nil];
//进入后台
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillEnterBackground) name:UIApplicationDidEnterBackgroundNotification object:nil];
-(void)onTerminate {
NSLog(@"杀掉进程");
}
/// 进入后台
- (void)applicationWillEnterBackground {
NSLog(@"1进入后台");
}
网友评论