iPhone 任务完成
几天前,我开始尝试 iPhone 平台的开发,在了解其多任务处理功能时,我发现了“任务完成”功能,这非常有用。
我用谷歌搜索了一下,阅读了developer.apple.com/iphone上提供的文档,但仍然没有找到一些东西:有没有一种方法可以让这个任务完成运行一个循环(可能是一个无限循环),或者一个计时器好像每10分钟跑一次?
我知道这就像“作弊”,他们可能有一些对策,但无论如何,尝试一下是件好事:)
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.
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 :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
随着任务完成?不会。但是,您可以说您的应用是具有后台功能的音频应用,例如,使用 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.)