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

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

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

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

}

原文地址:https://www.cnblogs.com/rendaochoucheng/p/6737640.html