UIApplicationDelegate
// app启动完毕时调用(建议在此初始化程序)
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:
(NSDictionary *)launchOptions
// app从主动转被动状态时调用
- (void)applicationWillResignActive:(UIApplication *)application
// app从被动转为主动状态时被调用
- (void)applicationDidBecomeActive:(UIApplication *)application
// app推送到后台时调用
- (void)applicationDidEnterBackground:(UIApplication *)application
// app后台要进入前台时调用
- (void)applicationWillEnterForeground:(UIApplication *)application
// 当程序完成载入后调用
- (void)applicationDidFinishLaunching:(UIApplication *)application
// app接收到内存警告时调用
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
// 当程序将要退出是被调用,通常是用来保存数据和一些退出前的清理工作。这个需要要设置UIApplicationExitsOnsuspend的键值
- (void)applicationWillTerminate:(UIApplication *)application
// 当系统时间发生改变时执行
- (void)applicationSignificantTimeChange:(UIApplication *)application