iPhone Task Completion

北城余情 提交于 2019-12-12 10:53:14

问题


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 :)


回答1:


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.)



来源:https://stackoverflow.com/questions/3388279/iphone-task-completion

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!