objective-c JSON parser comparison: which is easier to use?
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.
精彩评论