Public Member Functions | |
(NSString *) | - stringWithObject: |
Return JSON representation (or fragment) for the given object. | |
Properties | |
NSArray * | errorTrace |
Return an error trace, or nil if there was no errors. | |
NSUInteger | maxDepth |
The maximum recursing depth. | |
NSUInteger | maxDepth |
The maximum recursing depth. |
NSNumber instances created with the +initWithBool: method are converted into the JSON boolean "true" and "false" values, and vice versa. Any other NSNumber instances are converted to a JSON number the way you would expect.
- (NSString*) stringWithObject: | (id) | value |
Returns a string containing JSON representation of the passed in value, or nil on error. If nil is returned and error
is not NULL, *error
can be interrogated to find the cause of the error.
value | any instance that can be represented as a JSON fragment |
- (NSArray*) errorTrace [read, copy, inherited] |
Note that this method returns the trace of the last method that failed. You need to check the return value of the call you're making to figure out if the call actually failed, before you know call this method.
- (NSUInteger) maxDepth [read, write, assign, inherited] |
Defaults to 512. If the input is nested deeper than this the input will be deemed to be malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can turn off this security feature by setting the maxDepth value to 0.
- (NSUInteger) maxDepth [read, write, assign, inherited] |
Defaults to 512. If the input is nested deeper than this the input will be deemed to be malicious and the parser returns nil, signalling an error. ("Nested too deep".) You can turn off this security feature by setting the maxDepth value to 0.