开发者

Is there an ideal transfer format for iphone web services?

开发者 https://www.devze.com 2022-12-18 16:48 出处:网络
I\'m desig开发者_开发知识库ning the back-end for an iphone application. I\'d like to use Core Data. Is there an ideal transfer format for iphone apps? I\'m leaning towards JSON unless there\'s some cu

I'm desig开发者_开发知识库ning the back-end for an iphone application. I'd like to use Core Data. Is there an ideal transfer format for iphone apps? I'm leaning towards JSON unless there's some custom binary thing. I'm probably using ruby on the backend.

For example, in the Flex/Flash world, you can install a small piece on your server that lets you send and receive strongly-typed objects - flash and your server piece take care of all the serialization and hydrating.


See the answers to this question.


JSON or XML has worked best for me in the past. There are some formats that the iPhone SDK handles natively (plist), but I'd avoid those as you may want to open up your service to other clients at later time.

The iPhone SDK includes a SAX parser (NSXMLParser), but you can freely import other libraries like libXML if you like DOM better. SAX fits a little better in low memory spaces though.

For JSON you'll need a third party lib... I think SimpleJSON is one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号