STDSJSONDecodable Protocol Reference

Conforms to NSObject
Declared in STDSJSONDecodable.h

+ decodedObjectFromJSON:error: required method

Initializes an instance of the class from its JSON representation.

+ (nullable instancetype)decodedObjectFromJSON:(nullable NSDictionary *)json error:(NSError **)outError

Parameters

json

The JSON dictionary that represents an object of this type

outError

If there was a missing required field or invalid field value, contains an instance of NSError.

Return Value

The object represented by the JSON dictionary. If the object could not be decoded, returns nil and populates the outError argument.

Discussion

Initializes an instance of the class from its JSON representation.

This method recognizes two categories of errors: - a required field is missing. - a required field value is in valid (e.g. expected ‘Y’ or ‘N’ but received ‘X’).

Errors populating optional fields are ignored.

Declared In

STDSJSONDecodable.h