iPhone 任务完成

发布于 2024-09-12 10:42:26 字数 227 浏览 3 评论 0原文

几天前,我开始尝试 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

轻拂→两袖风尘 2024-09-19 10:42:26

随着任务完成?不会。但是,您可以说您的应用是具有后台功能的音频应用,例如,使用 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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文