1

I am working on my first iOS app and looking for the best way to implement the communication channel between iOS client and the server. Basically, I need to have a background thread that would send updates to the server say every 5 minutes.

From what I googled so far I think I would need to use some combination of NSOperation and NSOperationQueue for background processing; also NSTimer for scheduling; and NSURLConnection for sending the update to server.

Does that sound about right? If somebody can point me to an example of how that might look like I would greatly appreciate it.

Thanks!

ymotov
  • 1,449
  • 3
  • 17
  • 28
  • You do know that iOS apps (except for UIBackgroundMode apps, of which you must have specific functionality to be one of these) cannot run in the background and thus you cannot send updates periodically? – Gruntcakes Jun 19 '12 at 03:58
  • http://stackoverflow.com/questions/11044095/ios-keep-an-app-running-like-a-service/11044108#11044108 – Gruntcakes Jun 19 '12 at 03:59
  • Thanks Martin. Yes the app I am working on will be communicating with a bluetooth accessory and so qualifies for the UIBackgroundMode. – ymotov Jun 19 '12 at 04:24

0 Answers0