在iphone中创建递归后台处理程序是否合法?(当app进入后台时处理) [英] Is it legal to create a recursive background handler in iphone?(processing when app enters the background)

查看:173
本文介绍了在iphone中创建递归后台处理程序是否合法?(当app进入后台时处理)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我为后台应用程序注册了一个应用程序,请输入后台并使用大约10分钟的后台处理程序来完成任务,在时间结束后,处理程序将调用finish块并在此块中再次创建后台处理程序将再获得10分钟等等,这样应用程序将保留在后台。我的意思是这样做好吗?或苹果会反对吗?

If I register an app for background app in did enter background and make a background handler with approximately 10 mins to finish the task, after the time is over the handler will call finishing block and in this block again create the background handler you will get again 10 mins and so on, in this way application will remain in background. I mean is it OK to do that....? or will apple object to this?

推荐答案

来自文档


运行后台任务的应用程序在
中的运行时间有限。 (你可以使用
backgroundTimeRemaining属性找出可用的时间。)如果你没有在时间到期之前为每个任务调用
endBackgroundTask:系统会杀死
应用程序。

所以,不,你不能无限期地在后台运行。

So, no, you can't indefinitely run in the background.

这篇关于在iphone中创建递归后台处理程序是否合法?(当app进入后台时处理)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆