Web services on iPhone
Which is better to parse JSON/XML on iPhone, so that i can interact with web apps. Also开发者_JS百科 which is the fastest and most efficient parser out there
TouchJSON is easier for the developer to use than XML parsing, for web services with lots of little files sent back and forth performance does not matter much because the bottleneck will be the network (unless for some reason you are sending very large data structures around).
(See other comment for AppStore apps.)
JSON: For Jailbroken platforms you can use Apple's private framework JSON.framework
. (Isn't it quite sad that Apple often needs developers to reinvent the wheels?)
XML: NSXMLParser
(which is more ObjC-friendly) or libxml2
(which has higher performance).
NSXMLParser is the best, you can use it easily.
Both has its own advantages. XML is more structured and organized than JSON. if you have complex data structure than use XML otherwise you can use JSON.
For XML you can use: NSXMLParser or GDataXMLParser
For JSON try: SBJSON
精彩评论