Encode / Decode JSON By Any Means Possible™
Objective-C C++ Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
AnyJSON.xcworkspace
AnyJSON
CLI
Example
.gitmodules
AnyJSON.podspec
LICENSE
README.md

README.md

AnyJSON

Encode / Decode JSON By Any Means Possible

AnyJSON implements the NSJSONSerialization API on platforms that do not support it (i.e. iOS < 5 and Mac OS X < 10.7), using the first available of the following 3rd-party libraries:

For anyone who appreciates lower-level Objective-C hacks, you won't want to miss how AnyJSON works its magic.

Compatibility

Supported Methods

The following methods are supported by AnyJSON.

+ (id)JSONObjectWithData:(NSData *)data options:(NSJSONReadingOptions)opt error:(NSError **)error + (NSData *)dataWithJSONObject:(id)obj options:(NSJSONWritingOptions)opt error:(NSError **)error

Supported Reading Options

  • NSJSONReadingMutableContainers is supported by JSONKit only.
  • NSJSONReadingMutableLeaves is not supported (it doesn't even work with NSJSONSerialization on iOS 5+).
  • NSJSONReadingAllowFragments is not supported but NextiveJSON always allows fragments.

Supported Writing Options

  • NSJSONWritingPrettyPrinted is supported by JSONKit, yajl_json, and SBJSON.

Unsupported Methods

The following methods are currently not supported by AnyJSON, and throw an AnyJSONUnimplementedException exception.

  • + (id)JSONObjectWithStream:(NSInputStream *)stream options:(NSJSONReadingOptions)opt error:(NSError **)error
  • + (NSInteger)writeJSONObject:(id)obj toStream:(NSOutputStream *)stream options:(NSJSONWritingOptions)opt error:(NSError **)error
  • + (BOOL)isValidJSONObject:(id)obj

Contact

Cédric Luthi

Mattt Thompson

License

AnyJSON is available under the MIT license. See the LICENSE file for more info.