1 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 2 NSLog(@"app启动完毕的时候调用"); 3 return YES; 4 } 5 6 - (void)applicationDidReceiveMemoryWarning:(UIApplication *)application { 7 NSLog(@"app接收到内存警告时调用"); 8 } 9 10 - (void)applicationDidEnterBackground:(UIApplication *)application { 11 NSLog(@"app进入后台的时候调用"); 12 } 13 14 - (void)applicationWillResignActive:(UIApplication *)application { 15 NSLog(@"app将要被挂起"); 16 } 17 18 - (void)applicationWillEnterForeground:(UIApplication *)application { 19 NSLog(@"app回到前台"); 20 } 21 22 - (void)applicationDidBecomeActive:(UIApplication *)application { 23 NSLog(@"app激活后"); 24 } 25 26 - (void)applicationWillTerminate:(UIApplication *)application { 27 NSLog(@"app将要关闭"); 28 } 29
1 int main(int argc, char * argv[]) { 2 @autoreleasepool { 3 return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 4 } 5 }