问题描述
在应用程序之前调用
结束? applicationWillResignActive:
的情况是否会发生:didFinishLaunchingWithOptions:
Can a scenario happen where applicationWillResignActive:
will be called before application:didFinishLaunchingWithOptions:
ends?
基本上,我可以依靠应用程序:didFinishLaunchingWithOptions:
始终完成在之前第一次触发applicationWillResignActive
?
Basically, can I count on application:didFinishLaunchingWithOptions:
to always be done before applicationWillResignActive
is triggered for the first time?
推荐答案
Apple的 ,表示 applicationWillResignActive:
作为您的应用程序通过处理运行循环来处理事件,该循环仅在应用程序:didFinishLaunchingWithOptions:
完成后开始。
Apple's iOS App Programming Guide in the "App States and Multitasking" Section, indicates applicationWillResignActive:
is called as part of your application's handling of events through processing the run loop, which only begins after application:didFinishLaunchingWithOptions:
has finished.
此外,应用程序生命周期事件总是发生在主线程上,因此其中一个事件不可能先抢占另一个或与每个事件并行运行其他。
Furthermore, application lifecycle events always happen on the main thread, so it wouldn't be possible for one of them to pre-empt the other or run in parallel with each other.
这篇关于在didFinishLaunchingWithOptions结束之前是否曾调用applicationWillResignActive?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!