方法简要
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
只在应用启动的时候调用,后面的launchOptions包含从外部启动应用时候的参数,如收到接送,点击推送打开应用的时候包含的信息。
applicationWillResignActive
应用background
前调用
applicationDidEnterBackground
应用background
调用
applicationWillEnterForeground
应用active
前调用
applicationDidBeconeActive
应用active
调用
applicationWillTerminate
应用not runing
(关闭)前调用
几个常用场景:
- 启动应用:
-
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
applicationDidBeconeActive
- 在应用内单击home:
-
applicationWillResignActive
applicationDidEnterBackground
- 应用在后台运行,再次打开应用:
-
applicationWillEnterForeground
applicationDidBeconeActive
- 双击home选择当前应用:
-
applicationWillResignActive
applicationDidBeconeActive
- 双击home选择其它应用:
-
applicationWillResignActive
applicationDidEnterBackground
- 双击home关闭应用:
-
applicationWillResignActive
applicationDidEnterBackground
applicationWillTerminate
AppDelegate中几个方法中相关的状态:
1.not running
2.background
3.active
实际应用的几种状态 :
(详见《iOS应用程序状态切关》http://blog.csdn.net/duanyipeng/article/details/7101829)
1.not running
2.background
3.active
4.inactive
5.suspended
时间: 2024-10-10 23:08:38