[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:@"UIApplicationDidEnterBackgroundNotification" object:nil]
- (void)applicationWillTerminate:(UIApplication *)application {
// 業(yè)務(wù)邏輯
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(comeHome:) name:@"UIApplicationDidEnterBackgroundNotification" object:nil];
(void)comeHome:(UIApplication *)application {
NSLog(@"進(jìn)入后臺(tái)");
}(void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"程序被殺死");
}(void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"程序被殺死");
}
寫上你的本地通知方法
最后譬圣,希望這篇文章能幫到你姐霍。