objective-c - didFinishLaunchingWithOptions 是否在某些应用程序 "exits"之后发生?

标签 objective-c ios

didFinishLaunchingWithOptions 是否发生在以下时间之后:

  1. applicationWillResignActive
  2. applicationDidEnterBackground
  3. applicationWillEnterForeground

还是只在 applicationWillTerminate 之后发生?

那么什么时候 applicationDidBecomeActive 发生呢?谢谢。

最佳答案

来自文档:

It is called after your application has been launched and its main nib file has been loaded. At the time this method is called, your application is in the inactive state. At some point after this method returns, a subsequent delegate method is called to move your application to the active (foreground) state or the background state.

当用户打开您的应用程序时就会发生这种情况。当应用程序准备好接收用户事件时,紧接着是 applicationDidBecomeActive。

当用户按下主页按钮时,将调用以下方法(按此顺序): - applicationWillResignActive - applicationDidEnterBackground

当用户再次打开您的应用且它处于后台时:

  • applicationWillEnterForeground
  • applicationDidBecomeActive

最后,在 iOS 3.x 或更早版本的设备上,将调用 applicationWillTerminate 而不是 applicationDidEnterBackground。或者使用不支持后台应用程序的设备(例如 3G)。

关于objective-c - didFinishLaunchingWithOptions 是否在某些应用程序 "exits"之后发生?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11334678/

相关文章:

objective-c - cocoa contentsOfDirectoryAtPath : method failing with error for certain users - Mac OS X

objective-c - 添加一个( double )变量到 NSMutableArray

ios - 无法获取组成员 (XMPP)

ios - SFSpeechRecognizer 没有正确处理上下文字符串

ios - 如何将 UInt8 数组转换为 Data? ( swift )

python - NSTextView 突出显示不触发

Objective-C - 检查 OS X 中的 FileVault 状态

ios - 如何禁用/启用 UITextField 中的返回键?

ios - 如何指定行高?

ios - 旧版本的应用程序如何应对更新的核心数据模型?