[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(comeHome:) name:@"UIApplicationDidEnterBackgroundNotification" object:nil];//进入后台的通知
//被杀死执行的方法
- (void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"程序被杀死");
}