#pragma mark 程序加载完毕(启动完毕)就会调用一次
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSLog(@"didFinishLaunchingWithOptions---程序加载完毕");
returnYES;
}
#pragma mark 应用程序失去焦点的时候调用(一个app如果失去焦点,就不能跟用户进行交互)
- (void)applicationWillResignActive:(UIApplication *)application
{
NSLog(@"applicationWillResignActive---失去焦点");
}
#pragma mark 程序进入后台就会调用
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSLog(@"applicationDidEnterBackground--后台");
}
#pragma mark 程序即将进入前台的时候调用
- (void)applicationWillEnterForeground:(UIApplication *)application
{
NSLog(@"applicationWillEnterForeground--前台");
}
#pragma mark 应用程序获得焦点的时候调用(一个app只有获得焦点之后才能跟用户进行交互)
- (void)applicationDidBecomeActive:(UIApplication *)application
{
NSLog(@"applicationDidBecomeActive---获得焦点");
}
#pragma mark 程序即将被关闭的时候可能会被调用
- (void)applicationWillTerminate:(UIApplication *)application
{
原文:http://www.cnblogs.com/ZippoatiOS/p/3763969.html