Custom objects can support manual JSON encoding. More...
#import <YAJLGen.h>
Public Member Functions | |
(id) | - JSON |
Provide custom and/or encodable object to parse to JSON string. |
Custom objects can support manual JSON encoding.
@interface CustomObject : NSObject @end @implementation CustomObject - (id)JSON { return [NSArray arrayWithObject:[NSNumber numberWithInteger:1]]; } @end
And then:
CustomObject *customObject = [[CustomObject alloc] init];
NSString *JSONString = [customObject yajl_JSON];
// JSONString == "[1]";
- (id) JSON |
Provide custom and/or encodable object to parse to JSON string.