Saturday, June 2, 2012

iOS: API for JSON Parsing

TouchJSON is a simple and easy to use API for JSON parsing.

https://github.com/TouchCode/TouchJSON

Only "gotcha" is that the documentation suggested that it could deserialize a JSON string into object. That only applies to classes wrapping primitives (i.e. NSNumber, NSString etc.). If you had created an object and expect the library to auto-instantiate and populate the members of the object for you, TouchJSON isn't going to do it.

So if you have a complex object (which most of us do), just use the NSDictionary option.

Otherwise it works well.

No comments:

Post a Comment