Class

NSJSONSerialization

You use the NSJSONSerialization class to convert JSON to Foundation objects and convert Foundation objects to JSON.

Overview

An object that may be converted to JSON must have the following properties:

Other rules may apply. Calling isValidJSONObject: or attempting a conversion are the definitive ways to tell if a given object can be converted to JSON data.

Symbols

Creating a JSON Object

+ JSONObjectWithData:options:error:

Returns a Foundation object from given JSON data.

+ JSONObjectWithStream:options:error:

Returns a Foundation object from JSON data in a given stream.

Creating JSON Data

+ dataWithJSONObject:options:error:

Returns JSON data from a Foundation object.

+ writeJSONObject:toStream:options:error:

Writes a given JSON object to a stream.

+ isValidJSONObject:

Returns a Boolean value that indicates whether a given object can be converted to JSON data.

Constants

NSJSONReadingOptions

Options used when creating Foundation objects from JSON data—see JSONObjectWithData:options:error: and JSONObjectWithStream:options:error:.

NSJSONWritingOptions

Options for writing JSON data.

Relationships

Inherits From