2017-09-25 29 views

回答

0

PerformFetchapplication:performFetchWithCompletionHandler:)被称为在背景你〜30秒,从该方法或返回过程将被终止。

如果终止,您的代码将永远与你PerformFetch覆盖进入finally块,也不会WillTerminateapplicationWillTerminate:)被调用。这会被iOS视为UIBackgroundFetchResult.Failed,因为PerformFetch未返回。

如果您在PerformFetch内标记通过BeginBackgroundTaskbeginBackgroundTaskWithName:expirationHandler:)的一些代码块的开始,然后,当操作系统终止PerformFetchexpirationHandler被调用。

相关问题