標籤:
//// AppDelegate.m#import "AppDelegate.h"@implementation AppDelegate/** * app載入完畢的時候調用(一般只調用一次) * */- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ NSLog(@"didFinishLaunchingWithOptions"); return YES;}/** * app失去焦點的時候調用(UI控制項不能正常使用) */- (void)applicationWillResignActive:(UIApplication *)application{ NSLog(@"applicationWillResignActive");}/** * app進入背景時候調用(app消失不見) */- (void)applicationDidEnterBackground:(UIApplication *)application{ NSLog(@"applicationDidEnterBackground");}/** * app進入前台的時候調用(app顯示出來) */- (void)applicationWillEnterForeground:(UIApplication *)application{ NSLog(@"applicationWillEnterForeground");}/** * 當app獲得焦點的時候調用(這時候整個app的UI控制項都能正常使用) */- (void)applicationDidBecomeActive:(UIApplication *)application{ NSLog(@"applicationDidBecomeActive");}//app進入後台:休眠, 不能接受事情(比如關閉)/** * app關閉的時候調用(一般情況下不會調用) */- (void)applicationWillTerminate:(UIApplication *)application{ NSLog(@"applicationWillTerminate");}@end
iOS AppDelegate的.m檔案解析