Yini  1.0
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Pages
NSObject(NSObject_DBJSON) Category Reference

Adds JSON generation to Foundation classes. More...

#import <NSObject+DBJSON.h>

Public Member Functions

(NSString *) - JSONFragment
 Returns a string containing the receiver encoded as a JSON fragment.
(NSString *) - JSONRepresentation
 Returns a string containing the receiver encoded in JSON.

Detailed Description

Adds JSON generation to Foundation classes.

This is a category on NSObject that adds methods for returning JSON representations of standard objects to the objects themselves. This means you can call the -JSONRepresentation method on an NSArray object and it'll do what you want.

Member Function Documentation

- (NSString *) JSONFragment

Returns a string containing the receiver encoded as a JSON fragment.

This method is added as a category on NSObject but is only actually supported for the following objects:

  • NSDictionary
  • NSArray
  • NSString
  • NSNumber (also used for booleans)
  • NSNull
Deprecated:
Given we bill ourselves as a "strict" JSON library, this method should be removed.
- (NSString *) JSONRepresentation

Returns a string containing the receiver encoded in JSON.

This method is added as a category on NSObject but is only actually supported for the following objects:

  • NSDictionary
  • NSArray

The documentation for this category was generated from the following file: