views:

46

answers:

2

What Format should data be in when going into a utility app from a server? JSON, XML or something else?

Edit:

I need to tell a client to tell his web guy to build me a web service or let me do it. I need to make sure I am asking for the right thing.

+1  A: 

There are good libraries for parsing and emitting both XML and JSON in Cocoa Touch. I recommend KissXML and either Stig Brautaset's JSON or TouchJSON.

Tom
Which one would you recommend ?
Moshe
+2  A: 

The best format is Apple's Plist format. The iPhone OS can quickly and easily parse this. It's faster and less memory intensive than XML.

Best of all, it requires no additional libraries or parsing code on the device.

August
Technically, it is XML. But I understand what you mean. Just to elaborate, list data can be very easily transformed into NSDictionaries, NSArrays, NSStrings, NSNumbers, etc. using initWithContentsOfFile: Very useful. (+1)
Jasarien
How would my serverside script make a plist? Generate the XML and save it as a .plist, or generate and serve it?
Moshe
Generate and serve it. I believe there are open source classes that can do this.
August