views:

65

answers:

1

I have to keep a NSThread or NSTimer when my iPhone application goes into background mode. Is it possible ? I have enabled the background modes in info.plist and opened readstream and writestream as follows ...(I am using UDP)

CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType,kCFStreamNetworkServiceTypeVoIP);

CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);

But when my application goes to background and locked state, NSThread or NSTimer is not calling . So please suggest me how to achieve background threading in iPhone background locked state ?

A: 

iOS 4 supports very limited activity when an app goes into background mode. You most certainly can't keep a thread running indefinitely. This is intentional, and the only way around it would be some kind of jail-break.

Marcelo Cantos
Hi Marcelos, how about this? "Task finishing - If your app is in mid-task when your customer leaves it, the app can now keep running to finish the task."
sfa
It only gets a limited time to do so.
Marcelo Cantos