开发者

How to stop App from entering background before asynchronous task has completed

I'm developing an iOS app which syncs with Dropbox. I use the Dropbox SDK for iOS. I'm facing the problem that the Dropbox sync consists of two asynchronous operat开发者_C百科ions of which only the first is completed when the app resigns the active state.

What would be a good way to prevent the app from resigning active (or terminating) before the asynchronous tasks have completed? Would a blocking call (with sensible timeout) in the applicationWillResignActive: method be an option? If yes, how would that be best implemented?

Thanks in advance for your support!

Cheers, Georg


I am pretty sure that preventing immediate termination of your app goes against the Interface Guidelines. If your app is eligible for backgrounding (GPS, VOIP or Audio playback), then you will be able to do whatever you need in the background. If not, for all I know, you should do whatever you need in the willResignActive: method as a preparation for your app termination. Don't forget that the user may also completely terminate the app and that you need to make sure everything works out fine in that scenario as well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜