AppDelegate文件下各方法的用法:(应用程序挂起、复原与终止)
AppDelegate文件下各方法的用法:(应用程序挂起、复原与终止): 首次运行: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions=====> 程序首次运行 - (void)applicationDidBecomeActive:(UIApplication *)application===> 程序重新激活 ! 首次关闭(home): - (void)applicationWillResignActive:(UIApplication *)application===> 程序将挂起 ! - (void)applicationDidEnterBackground:(UIApplication *)application===> 程序进入后台 ! 再次运行: - (void)applicationWillEnterForeground:(UIApplication *)application===> 程序进入前台 ! - (void)applicationDidBecomeActive:(UIApplication *)application===> 程序重新激活 ! 再次关闭: - (void)applicationWillResignActive:(UIApplication *)application===> 程序将挂起 ! - (void)applicationDidEnterBackground:(UIApplication *)application===> 程序进入后台 ! 终止程序: - (void)applicationWillTerminate:(UIApplication*)application===> 程序将终止 !
在方法中利用:NSLog(@"%@", NSStringFromSelector(_cmd));输出正执行的方法;