application 代理方法
2017-07-24 本文已影响16人
目染江夏
关于appdelegate 的一些代理方法
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
//设置rootVC 和一些操作
//1
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
NSLog(@"\n 2: ===> 程序暂行 !");
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"\n 3: ===> 程序进入后台 !");
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
NSLog(@"\n 4: ===> 程序进入前台 !");
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
NSLog(@"\n 5: ===> 程序重新激活 !");
}
- (void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"\n 6: ===> 程序意外暂行 !");
}
第一次运行出来走 1,5 :
didFinishLaunchingWithOptions ,applicationDidBecomeActive
进入后台 : 2,3
applicationWillResignActive,applicationDidEnterBackground
重新打开 :4,5
applicationWillEnterForeground,applicationDidBecomeActive