IOS AppDelegate.m 详解<转>
IOS AppDelegate.m 详解<转>
王斌_Duke 发表于2年前
IOS AppDelegate.m 详解<转>
  • 发表于 2年前
  • 阅读 7
  • 收藏 0
  • 点赞 2
  • 评论 0

【腾讯云】买域名送云解析+SSL证书+建站!>>>   

1. application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

 

Tells the delegate when the application has launched and may have additional launch options to handle.

 

在应用程序启动后,要执行的委托调用。

 

 

 

2. applicationWillResignActive:(UIApplication *)application

 

Tells the delegate that the application is about to become inactive.This method is called to let your application know that it is about to move from the active to inactive state.After calling this method, the application also posts a UIApplicationWillResignActiveNotification notification to give interested objects a chance to respond to the transition.

 

在应用程序将要由活动状态切换到非活动状态时候,要执行的委托调用,如 按下 home 按钮,返回主屏幕,或全屏之间切换应用程序等。

 

 

 

3. applicationDidEnterBackground:(UIApplication *)application

 

Tells the delegate that the application is now in the background.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.

 

在应用程序已进入后台程序时,要执行的委托调用。

 

 

 

4. applicationWillEnterForeground:(UIApplication *)application

 

Tells the delegate that the application is about to enter the foreground.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.

 

在应用程序将要进入前台时(被激活),要执行的委托调用,刚好与 applicationWillResignActive 方法相对应。

 

 

 

5. applicationDidBecomeActive:(UIApplication *)application

 

Tells the delegate that the application has become active.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.

 

在应用程序已被激活后,要执行的委托调用,刚好与  applicationDidEnterBackground 方法相对应。

 

 

6. applicationWillTerminate:(UIApplication *)application

 

Tells the delegate when the application is about to terminate.Called when the application is about to terminate. Save data if appropriate.

 

在应用程序要完全推出的时候,要执行的委托调用。


  • 打赏
  • 点赞
  • 收藏
  • 分享
共有 人打赏支持
粉丝 7
博文 21
码字总数 4927
×
王斌_Duke
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
* 金额(元)
¥1 ¥5 ¥10 ¥20 其他金额
打赏人
留言
* 支付类型
微信扫码支付
打赏金额:
已支付成功
打赏金额: