IOS-Frameworks-Foundation-NSNotification.h
跳出程序或进入后台会发出通知
UIApplication *app = [UIApplication sharedApplication];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(gotoBack) name:UIApplicationWillResignActiveNotification object:app];