2017-09-25 13 views

답변

0

PerformFetch (application:performFetchWithCompletionHandler:)는 그 방법 또는에서 리턴 ~ 30 초 정도가배경에 호출 될 때 프로세스가 종료됩니다. 종료하면

, 당신의 코드는 PerformFetch 재정으로 finally 블록을 입력하지 않습니다,도 WillTerminate (applicationWillTerminate:)가 호출됩니다. PerformFetch이 반환되지 않았으므로 iOS에서 UIBackgroundFetchResult.Failed으로 처리됩니다.

그런 다음 PerformFetchBeginBackgroundTask (beginBackgroundTaskWithName:expirationHandler:)를 통해 코드의 일부 블록의 시작을 플래그 경우 , OS가 PerformFetch를 종료 할 때 expirationHandler가 호출됩니다.