2011-12-10 25 views
0

私は7分ごとにサーバーからXMLデータをダウンロードして解析するアプリを作った。バックグラウンドで長時間実行するタスク

ほとんどの場合backgoundで動作したいので、変更があれば、このアプリはローカル通知を送信できます。

私は、長時間実行されるバックグラウンドタスクのためのAppleのrequirmentsにを読んで、何の適切なカテゴリがありません:

For tasks that require more execution time to implement, you must request specific permissions to run them in the background without their being suspended. In iOS, only specific app types are allowed to run in the background: 

Apps that play audible content to the user while in the background, such as a music player app 
Apps that keep users informed of their location at all times, such as a navigation app 
Apps that support Voice over Internet Protocol (VoIP) 
Newsstand apps that need to download and process new content 
Apps that receive regular updates from external accessories 

任意のアドバイスは?

+0

xmlをサーバーから7分ごとにダウンロードする理由を知っているかもしれませんか? – aherlambang

+0

...変更がある場合、このアプリはローカル通知を送信できます – Shmidt

答えて

1

NSThreadを作成すると、スリープのある無限ループではなく、NSTimerを使用する方がよいでしょう。 timerWithTimeIntervalで初期化することができます:invocation:repeats:そして、あなたのバックグラウンドスレッドを実行ループでスケジュールします。

関連する問題