iPhone任务完成 [英] iPhone Task Completion

查看:72
本文介绍了iPhone任务完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几天前,我开始尝试为iPhone平台进行开发,在阅读有关它的多任务功能时,我发现任务完成"非常有用.

I started a few days ago to experiment development for the iPhone platform, and while reading about it's multi-tasking capabilities I found out the "task completion", which can be very useful.

我在Google上做了一些搜索,阅读了developer.apple.com/iphone上的可用文档,但是仍然没有发现什么:是否有一种方法可以使此任务完成运行一个循环(可能是无限循环),或者计时器将每10分钟运行一次?

I googled a little, read the documentation available at developer.apple.com/iphone, but still haven't found something: is there a way to have this task completion run a loop (possibly an infinite one), or a timer which would run like every 10 minutes?

我知道这就像作弊",并且它们可能有一些对策,但是无论如何,尝试一下是一件好事:)

I know it's like "cheating" and they probably have some countermeasures, but anyway, it'd be a good thing to try :)

推荐答案

任务完成了吗?不能.但是,您可以说您的应用程序是具有后台功能的音频应用程序,例如,使用kAudioSessionProperty_OverrideCategoryMixWithOthers属性设置音频会话,循环播放一些没有声音的音频.这样一来,用户就可以退出,启动iPod或其他功能,并在应用继续运行时正常播放.

With task completion? No. However, you can say your app is an audio app with background capabilities for example, set up an audio session with the kAudioSessionProperty_OverrideCategoryMixWithOthers property, loop some audio that plays no sound. This will let the user exit, launch iPod or whatnot, and have it play as normal while your app continues to run.

我已经在示例应用程序中对此进行了测试,并且可以正常工作.但是,它是可疑的,我不推荐使用. (如果苹果发现了,它也很可能会被拒绝.)

I've tested this in a sample app, and it works. However, it's dubious and I wouldn't recommend it. (It's also likely to be rejected if Apple ever finds out.)

这篇关于iPhone任务完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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