RBJson Class Reference

Inherits from NSObject
Declared in RBJson.h

Overview

JSON serialisation and deserialisation convenience methods.

+ deserialiseFromData:error:

Deserialise the given JSON data to a property list.

+ (nullable id)deserialiseFromData:(nonnull NSData *)data error:(NSError *_Nullable *_Nullable)error

Parameters

data

The NSData object.

error

This is set to the error if one occurs, or to nil if no error occurs.

Return Value

The resulting property list, or nil if there was an error.

Declared In

RBJson.h

+ deserialiseFromData:error:removeNullValues:

Deserialise the given JSON data to a property list.

+ (nullable id)deserialiseFromData:(nonnull NSData *)data error:(NSError *_Nullable *_Nullable)error removeNullValues:(BOOL)removeNullValues

Parameters

data

The NSData object.

error

This is set to the error if one occurs, or to nil if no error occurs.

removeNullValues

Whether or not explicitly set null values should be removed.

Return Value

The resulting property list, or nil if there was an error.

Declared In

RBJson.h

+ deserialiseFromString:error:

Deserialise the given JSON string to a property list.

+ (nullable id)deserialiseFromString:(nonnull NSString *)string error:(NSError *_Nullable *_Nullable)error

Parameters

string

The JSON string value.

error

This is set to the error if one occurs, or to nil if no error occurs.

Return Value

The resulting property list, or nil if there was an error.

Declared In

RBJson.h

+ deserialiseFromString:error:removeNullValues:

Deserialise the given JSON string to a property list.

+ (nullable id)deserialiseFromString:(nonnull NSString *)string error:(NSError *_Nullable *_Nullable)error removeNullValues:(BOOL)removeNullValues

Parameters

string

The JSON string value.

error

This is set to the error if one occurs, or to nil if no error occurs.

removeNullValues

Whether or not explicitly set null values should be removed.

Return Value

The resulting property list, or nil if there was an error.

Declared In

RBJson.h

+ deserialiseFromFile:error:

Deserialise the given JSON file path to a property list.

+ (nullable id)deserialiseFromFile:(nonnull NSString *)filePath error:(NSError *_Nullable *_Nullable)error

Parameters

filePath

The path to a JSON file.

error

This is set to the error if one occurs, or to nil if no error occurs.

Return Value

The resulting property list, or nil if there was an error.

Declared In

RBJson.h

+ deserialiseFromFile:error:removeNullValues:

Deserialise the given JSON file path to a property list.

+ (nullable id)deserialiseFromFile:(nonnull NSString *)filePath error:(NSError *_Nullable *_Nullable)error removeNullValues:(BOOL)removeNullValues

Parameters

filePath

The path to a JSON file.

error

This is set to the error if one occurs, or to nil if no error occurs.

removeNullValues

Whether or not explicitly set null values should be removed.

Return Value

The resulting property list, or nil if there was an error.

Declared In

RBJson.h

+ serialiseFromPropertyList:error:

Serialises the given property list to JSON data.

+ (nullable NSData *)serialiseFromPropertyList:(nonnull id)propertyList error:(NSError *_Nullable *_Nullable)error

Parameters

propertyList

The property list to serialise.

error

This is set to the error if one occurs, or to nil if no error occurs.

Return Value

The resulting JSON NSData object.

Declared In

RBJson.h