开发者

objective-c JSON parser comparison: which is easier to use?

开发者 https://www.devze.com 2023-02-14 13:02 出处:网络
I\'ve seen the comparison thread on objective-c JSON parsers here: Comparison of JSON Parser for Objective-C (JSON Framework, 开发者_如何学JAVAYAJL, TouchJSON, etc) but can someone offer their opinion

I've seen the comparison thread on objective-c JSON parsers here: Comparison of JSON Parser for Objective-C (JSON Framework, 开发者_如何学JAVAYAJL, TouchJSON, etc) but can someone offer their opinions on which is the easiest/simplest to setup and to use?


I prefer json-framework simply because it just works =) Here is how to parse:

NSObject* parsed_obj = [[[[SBJsonParser alloc] init] autorelease] objectWithData: data];

And that's all!

parsed_obj could be NSArray or NSDictionary. You should check this using iskindOfClass: method. And then you work with with simple containers. BTW it has convenient categories for NSDictionary, NSArray, NSData in the later release.

0

精彩评论

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