判断程序进入后台还是被杀死

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(comeHome:) name:@"UIApplicationDidEnterBackgroundNotification" object:nil];//进入后台的通知

 

//被杀死执行的方法
- (void)applicationWillTerminate:(UIApplication *)application {

    NSLog(@"程序被杀死");

}

 

posted on 2017-04-20 11:06  人道酬诚  阅读(170)  评论(0编辑  收藏  举报