AppDelegate方法

AppDelegate方法

1
2
3
4
5
6
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

NSLog(@"①告诉代理进程启动但还没进入状态保存");

return YES;
}
1
2
3
4
5
6
7
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

NSLog(@"②告诉代理启动基本完成程序准备开始运行");

return YES;
}
1
2
3
4
5
- (void)applicationWillResignActive:(UIApplication *)application {

NSLog(@"③当应用程序将要入非活动状态执行,在此期间,应用程序不接收消息或事件,比如来电话");

}
1
2
3
4
- (void)applicationDidBecomeActive:(UIApplication *)application {

NSLog(@"④当应用程序进入活动状态执行");
}
1
2
3
4
5
- (void)applicationDidEnterBackground:(UIApplication *)application {

NSLog(@"⑤当程序被推送到后台的时候调用");

}
1
2
3
4
- (void)applicationWillEnterForeground:(UIApplication *)application {

NSLog(@"⑥当程序从后台将要重新回到前台时候调用");
}
1
2
3
4
5
- (void)applicationWillTerminate:(UIApplication *)application {

NSLog(@"⑦当程序将要退出是被调用");

}
1
2
3
4
5
- (void)applicationDidFinishLaunching:(UIApplication *)application {

NSLog(@"⑧当程序载入后执行");

}