CBLMutableArray

CBLMutableArray provides access to array data.

  • Creates a new empty CBLMutableArray object.

    Declaration

    Objective-C

    + (nonnull instancetype)array;
  • Initialize a new empty CBLMutableArray object.

    Declaration

    Objective-C

    - (nonnull instancetype)init;
  • Initialize a new CBLMutableArray object with data. Allowed value types are CBLArray, CBLBlob, CBLDictionary, NSArray, NSDate, NSDictionary, NSNumber, NSNull, and NSString. The NSArrays and NSDictionaries must contain only the above types.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithData:(nonnull NSArray *)data;

    Parameters

    data

    The data.

  • Initialize a new CBLMutableArray object with data as a JSON string.

    Declaration

    Objective-C

    - (nullable instancetype)initWithJSON:(nonnull NSString *)json
                                    error:(NSError *_Nullable *_Nullable)error;

    Parameters

    json

    The JSON string with data.

    error

    On return, the error if any.

    Return Value

    The CBLMutableArray object, nil in case of JSON Error .

  • Set data with JSON string.

    Declaration

    Objective-C

    - (BOOL)setJSON:(nonnull NSString *)json
              error:(NSError *_Nullable *_Nullable)error;

    Parameters

    json

    The JSON string with data.

    error

    On return, the error if any.

    Return Value

    True on success, false on failure.