views:

53

answers:

1

Hey guys,

New to iPhone dev here. Just wondering what's the best way to connect an iPhone app frontend (based on Cocoa) to a php/MySql based backend?

The iPhone application will frequently access and change data stored on our server.

Many thanks

+4  A: 

You will need to create a web service that will expose a set of APIs that are then use by your iPhone app to push/pull data. You may then choose to cache the data locally (on the iPhone) in a sqlite3 database. The most common data transfer formats are JSON and XML.

Paul Ardeleanu
Further to your answer here is link to JSON library for iPhone: http://stackoverflow.com/questions/4025349/is-there-an-3rd-party-library-for-parsing-json-on-the-iphone/4025379#4025379
infinity
For a discussion on the best JSON library see: http://stackoverflow.com/questions/286087/best-json-library-to-use-when-developing-an-iphone-application . I use json-framework.
Paul Ardeleanu
Thanks guys, any resources for XML? (for comparison)
tyng
There is TouchXML (part of the touchcode project). http://github.com/schwa/TouchCode
Paul Ardeleanu
If you're creating something from scratch anyway, I'd go with JSON, it's much faster to transfer and parse. Binary plists are also awesome :)
Canada Dev
Thanks for all your comments guys, will get into JSON pretty soon.
tyng