我在应用的applicationWillTerminate方法中添加了一些代码:
dispatch_async(dispatch_queue_create(@"some name", DISPATCH_QUEUE_SERIAL), ^{
//Some Code
});
我的代码有可能不会执行吗? 我有一些问题表明在某些情况下此代码不会执行。
答案 0 :(得分:0)
如果您的应用程序崩溃或被暂停,则不会调用此方法。
有关更多信息,您可以查看文档Apple documentation (UIApplicationDelegate)和Apple documentation (The App Life Cycle)
答案 1 :(得分:-1)
它很有可能无法执行,或者它开始执行并将在执行过程中被杀死。