程序生命周期
// Created by Yan on 16/4/20.font
// Copyright © 2016年 baidu. All rights reserved.
#import "AppDelegate.h"
AppDelegate ()
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
NSLog(@"程序启动完毕");
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
NSLog(@"程序即将暂停");
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"程序进入后台");
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
NSLog(@"程序即将进入前台");
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
NSLog(@"程序再次激活");
}
- (void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"程序即将意外退出");
}
@end
程序第一次启动
2016-04-20 23:50:31.266 runtime[4416:298880] 程序启动完毕
2016-04-20 23:50:31.271 runtime[4416:298880] 程序再次激活
command shift + H/ home键回到后台
2016-04-20 23:50:36.352 runtime[4416:298880] 程序即将暂停
2016-04-20 23:50:37.084 runtime[4416:298880] 程序进入后台
再次启动
2016-04-20 23:50:39.008 runtime[4416:298880] 程序即将进入前台
2016-04-20 23:50:39.533 runtime[4416:298880] 程序再次激活