Translation between native collections in Objective-C and serialized formats like JSON.
Static methods always return nil
if an error occurs (such as JSON could not be passed or was an invalid expected type)
You may see the method [- jsonString]
, this is an internal method you should not call directly. use the provided [- jsonValue]
provided.
+ objectFromJson:
- convert JSON string into an object.- dictionaryValue
- convert an objects properties into anNSDictionary
.- jsonValue
- translate any object into JSON.
The kind of class is tested in this order:
NSDictionary
: A JSON object is returned based on the key/values of the dictionary.NSArray
: A JSON array is returned with the items in the array.NSString
: A safely double-quoted string is returned.NSNumber
: Raw number is returned.- If none of the above match then the object is converted using
[- dictionaryValue]
and then the JSON for that dictionary is returned.
This is the opposite of [- jsonValue]
, it will perform the same checks in reverse.
+ arrayWithJsonString:
- create anNSArray
from a JSON string.+ arrayWithJsonData:
- create anNSArray
from a JSON data.
+ dictionaryWithJsonData:
- create anNSDictionary
from a JSON data.+ dictionaryWithJsonString:
- create anNSDictionary
from a JSON string.
+ mutableDictionaryWithJsonString:
- create anNSMutableDictionary
from a JSON string.+ mutableDictionaryWithJsonData:
- create anNSMutableDictionary
from a JSON data.+ mutableDictionaryWithJsonFile:
- create anNSMutableDictionary
from a file that contains JSON.