Archive for June, 2009

YAJL JSON Parser (Objective-C Bindings)

Monday, June 15th, 2009

I recently was investigating using a more lightweight JSON parser for iPhone projects (other than the standard SBJSON library) and came across the YAJL C JSON library. While using it as a document style parser didn’t result in a huge performance gain, it does a support a streaming “SAX” style parser which might help memory usage in larger documents.

Hopefully, sometime soon I will do some performance comparisons. In the meantime, if you try these bindings, let me know how it goes. You can find it on github at: http://github.com/gabriel/yajl-objc.

Right now, I only have a framework (for 10.5) built, but check back and at some point will have a static iPhone library built as well.

Here are some quick usage examples:

Usage

Usage (Streaming)

Usage (Document style)

Updated (07/01/2009): Updated usage to use new API changes for better streaming support.