在用户强制关闭我的申请后,我可以完成下载任务吗?怎么样?
解决方法
If an iOS app is terminated by the system and relaunched,the app can use the same identifier to create a new configuration object and session and retrieve the status of transfers that were in progress at the time of termination. This behavior applies only for normal termination of the app by the system. If the user terminates the app from the multitasking screen,the system cancels all of the session’s background transfers. In addition,the system does not automatically relaunch apps that were force quit by the user. The user must explicitly relaunch the app before transfers can begin again.
更新:(如评论中所述)
Refer the apple documentation,它说,
This method lets your app know that it is about to be terminated and purged from memory entirely. You should use this method to perform any final clean-up tasks for your app,such as freeing shared resources,saving user data,and invalidating timers. Your implementation of this method has approximately five seconds to perform any tasks and return. If the method does not return before time expires,the system may kill the process altogether.
For apps that do not support background execution or are linked
against iOS 3.x or earlier,this method is always called when the user
quits the app. For apps that support background execution,this method
is generally not called when the user quits the app because the app
simply moves to the background in that case. However,this method may
be called in situations where the app is running in the background
(not suspended) and the system needs to terminate it for some reason.After calling this method,the app also posts a UIApplicationWillTerminate notification to give interested objects a chance to respond to the transition.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。