4

is there any open source code for syncing an iPhone with a server (preferably REST)?

Found nothing on github and google code.

Regards...

Stefan
  • 28,843
  • 15
  • 64
  • 76

4 Answers4

5

I have been working with a project called ObjectiveResource (Github project here: http://github.com/yfactorial/objectiveresource/tree/master), which is focused mainly on the communication layer between your iphone models and a REST based web service. It is targeted at rails applications but should work with any REST api. Part of that project is a more sync oriented solution that is still in early development, but which has been discussed quite a bit lately in the objective resource google group at http://groups.google.com/group/objectiveresource?hl=en.

I highly recommend objective resource, I've been using it along with sqlitepersistenobjects to handle sync on my iphone project.

paulthenerd
  • 9,487
  • 2
  • 35
  • 29
4

I suggest using the excellent ASIHTTPRequest source from All-Seeing Interactive: http://allseeing-i.com/ASIHTTPRequest. I'm doing this, and so are several released iPhone apps, so you can be sure the code is pretty solid.

This is a wrapper around the CFNetwork API that makes some of the more tedious aspects of communicating with web servers easier. It is written in Objective-C and works in both Mac OS X and iPhone applications.

It is suitable for performing basic HTTP requests and interacting with REST-based services (GET / POST / PUT / DELETE). The ASIFormDataRequest subclass makes it easy to submit POST data and files using multipart/form-data.

Jane Sales
  • 13,526
  • 3
  • 52
  • 57
3

I would recommend checking out RestKit: http://restkit.org/ It provides an excellent API for accessing RESTful web services and representing the remote resources as local objects, including persisting them to Core Data.

Blake Watters
  • 6,607
  • 1
  • 43
  • 33
3

I've used Adrian Kosmaczewski's iPhone Rest Wrapper with success. See also this SO question.

Community
  • 1
  • 1
Daniel Dickison
  • 21,832
  • 13
  • 69
  • 89