SBJson (aka json-framework)
- BSD license.
- Super-simple high-level API:
-JSONValueon any NSString instance parses the JSON text in that string.
-JSONRepresentationon any NSArray or NSDictionary returns an NSString with the JSON representation of the object.
- Object-oriented API providing a good balance between simplicity and flexibility. Check out:
- Streaming JSON support. You can start parsing a JSON document--and return parsed chunks of it to your program--before it has finished downloading from the server. Check out:
- Works with/without garbage collection.
- Pretty-printing of JSON output.
- Sorted dictionary keys in JSON output.
- Configurable recursion depth limit for added security.
The simplest way to start using JSON in your application is to simply
copy all the source files (the contents of the
Classes folder) into
your own Xcode project.
- In the Finder, navigate to the
$PATH_TO_SBJSON/Classesfolder and select all the files.
- Drop-and-drop them into your Xcode project.
- Tick the Copy items into destination group's folder option.
#import "SBJson.h"in your source files. (or simply include the particular classes you wish to use.)
That should be it. Now create that Twitter client!
If you're upgrading from a previous version, make sure you're deleting the old SBJson classes first, moving all the files to Trash.
Install API documentation into Xcode
From the top-level project directory, run the
./InstallDocumentation.sh program. This compiles the documentation and installs it so it integrates with Xcode. Now open Xcode documentation and search for SBJson. You should see a lot of the classes. (Generating the documentation requires Doxygen to be installed.)
Alternative installation instructions
Copying the SBJson classes into your project isn't the only way to use this framework. (Though it is the simplest.) I've created a couple of examples that link to this framework rather than copy the sources. Check them out at github: