关于iPhone:iOS中的JSON本地支持?

Native JSON support in iOS?

是否存在用于从iOS SDK中的服务器解析JSON的类? (类似于用于XML的NSXML,并通过RSS进行扩展。)


自iOS5起,JSON已被本地支持,无需第三者框架。
NSJSONSerialization类支持此功能!


iOS 5的更新答案:

JSON支持现在是iOS中带有NSJSONSerialization的本机,但是就性能而言,与JSONKit相比,它显得苍白无力,正如John Englehart在JSONKit自述文件中所述:

UPDATE: (2011/12/18) The benchmarks below were performed before Apples NSJSONSerialization was available (as of Mac OS X 10.7 and iOS 5). The obvious question is: Which is faster, NSJSONSerialization or JSONKit? According to this site, JSONKit is faster than NSJSONSerialization. Some quick"back of the envelope" calculations using the numbers reported, JSONKit appears to be approximately 25% to 40% faster than NSJSONSerialization, which is pretty significant.

enter image description here

这是一篇博客文章,探讨了更具体的基准:iOS比较的JSON库


此线程中列出了iPhone的几个JSON库:
https://stackoverflow.com/questions/286087/best-json-library-to-use-when-developing-an-iphone-application


关于JSONKit基准测试,当前和iOS版本的运行情况还不算快。创建用于测试速度的测试应用程序后,速度更快,但不如自定义实现OKJSONParser


NextiveJson应该是iOS JSON的快速库
NextiveJson