在后台继续执行任务
我是否缺少多任务功能的某些东西?我知道我们可以在后台执行任务,但我真正需要的是当应用程序进入后台时任务继续执行。所以我需要的与在后台启动新任务不同。如果图像正在视图中加载,并且用户按下主页按钮使应用程序进入后台,我希望图像继续加载,并且当用户再次激活应用程序时,他可以看到所有加载的图像。这怎么能做到呢?多谢。
Am I missing something here with Multitasking feature. I know we can execute a task in background, but what I really need is that task continues execution when app goes in background. So what I need is different than starting a new task in background. If images are being loaded in a view and user presses the home button to make the app go in background, I want that images continue to load and when user makes the app active again, he can see all the loaded images. How can this be done? Thanks a lot.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据提到的文档,如果您在前台使用
beginBackgroundTaskWithExpirationHandler:
,它将继续在后台执行直到结束。一旦该任务结束,您的申请就有资格被暂停。According to mentioned documentation, if you use
beginBackgroundTaskWithExpirationHandler:
while in foreground, it will keep executing in background until it ends. Once that task has ended, your application is eligible to be suspended.