// 學(xué)習(xí)代理方法拧咳,只需要知道這個什么時候調(diào)用伯顶,這個方法可以用來干嘛
// 程序啟動完成的時候調(diào)用
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
NSLog(@"%s",__func__);
return YES;
}
// 當(dāng)app失去焦點(diǎn)的時候調(diào)用
- (void)applicationWillResignActive:(UIApplication *)application {
NSLog(@"%s",__func__);
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
// app進(jìn)入后臺的時候調(diào)用
// app忽然打斷的時候,在這里保存一些需要用到的數(shù)據(jù)
- (void)applicationDidEnterBackground:(UIApplication *)application {
NSLog(@"%s",__func__);
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
// app進(jìn)入即將前臺
- (void)applicationWillEnterForeground:(UIApplication *)application {
NSLog(@"%s",__func__);
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
// 當(dāng)app獲取到焦點(diǎn)的時候調(diào)用骆膝,意味著app可以與用戶交互
- (void)applicationDidBecomeActive:(UIApplication *)application {
NSLog(@"%s",__func__);
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
// app被關(guān)閉的時候調(diào)用
- (void)applicationWillTerminate:(UIApplication *)application {
NSLog(@"%s",__func__);
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
// app接收到內(nèi)存警告的時候調(diào)用
// 清空圖片的緩存
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
NSLog(@"%s",__func__);
}