ios 杀死程序和程序进入后台

杀死程序时调用

//进程杀死时会调用这个
- (void)applicationWillTerminate:(UIApplication *)application{
    DLog(@"进程杀死时会调用这个");
}

进入后台时调用这个

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(comeHome:) name:@"UIApplicationDidEnterBackgroundNotification" object:nil];


- (void)comeHome:(UIApplication *)application {
    NSLog(@"进入后台");
}

你可能感兴趣的:(ios 杀死程序和程序进入后台)