I am developing an iPhone application that downloads data from a website. The website database is implemented in SQL and the sit开发者_开发问答e itself uses the classic ASP interface.
I am unsure as to which method would be best for transferring data to and from the server. Both JSON and SOAP require XML processing and I'm not sure how that affects performance or which of those two is best.
What would be the best method in general for data transfer given the server configuration we currently have?
I very new to this field and I'm a bit confused. Any help would be appreciated.
JSON is generally much simpler to use than SOAP (or any XML format), and SOAP support in objective-c is very limited. I'm not sure about performance, but JSON doesn't use any XML parsing. There are two good JSON libraries for iPhone, TouchJSON and json-framework--they're pretty similar, but I've heard that TouchJSON might be more actively maintained. I've never used ASP, but this question has some resources for JSON libraries.
using a Plist in my opinion is the best option, it's basically an apple specific XML format that can be converted into NSObjects in a single line of code on any iOS system and it is by far the fastest.
See this question: create Plist in .net from list of objects
I use it to load over 100,000 objects for syncing to my iPad Core Data app, works like a champ. Watch the video link posted on that question, very informative.
精彩评论