Is there any system level background queue process in iPhone?

允我心安 提交于 2019-12-04 03:59:44

问题


I need to save a big file, sometime it takes a very long time to finish, user might just close the application. I am wondering whether the iPhone SDK could take over the unfinished big task.

Appears iPhone's own mail system could do background send. I prepared a email, click send, then close the mail app immediately. In home page, after several seconds, I heard a sound and the email was delivered.


回答1:


You're out of luck. Only Apple's own apps are allowed to operate in the background. But I think your app gets some time to finish up when the user closes the app.




回答2:


You can't run the app in the background as PEZ says. However you could spin off a thread to perform the task and then at least the user can get on with doing other things in your application.




回答3:


If I remember correctly, your app gets 5 seconds between the user pressing the home button and the iPhone OS killing it if you're not done.



来源:https://stackoverflow.com/questions/397846/is-there-any-system-level-background-queue-process-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!