CBLMutableArray

@protocol CBLMutableArray <CBLArray, CBLMutableArrayFragment>

CBLMutableArray protocol defines a set of methods for getting and setting array data.

  • Sets a value at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setValue:(nullable id)value atIndex:(NSUInteger)index;

    Swift

    func setValue(_ value: Any?, at index: UInt)

    Parameters

    value

    The value.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets an String object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setString:(nullable NSString *)value atIndex:(NSUInteger)index;

    Swift

    func setString(_ value: String?, at index: UInt)

    Parameters

    value

    The String object.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets an NSNumber object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setNumber:(nullable NSNumber *)value atIndex:(NSUInteger)index;

    Swift

    func setNumber(_ value: NSNumber?, at index: UInt)

    Parameters

    value

    The NSNumber object.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets an integer value at the given index.

    Declaration

    Objective-C

    - (void)setInteger:(NSInteger)value atIndex:(NSUInteger)index;

    Swift

    func setInteger(_ value: Int, at index: UInt)

    Parameters

    value

    The integer value.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a long long value at the given index.

    Declaration

    Objective-C

    - (void)setLongLong:(long long)value atIndex:(NSUInteger)index;

    Swift

    func setLongLong(_ value: Int64, at index: UInt)

    Parameters

    value

    The long long value.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a float value at the given index.

    Declaration

    Objective-C

    - (void)setFloat:(float)value atIndex:(NSUInteger)index;

    Swift

    func setFloat(_ value: Float, at index: UInt)

    Parameters

    value

    The float value.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a double value at the given index.

    Declaration

    Objective-C

    - (void)setDouble:(double)value atIndex:(NSUInteger)index;

    Swift

    func setDouble(_ value: Double, at index: UInt)

    Parameters

    value

    The double value.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a boolean value at the given index.

    Declaration

    Objective-C

    - (void)setBoolean:(BOOL)value atIndex:(NSUInteger)index;

    Swift

    func setBoolean(_ value: Bool, at index: UInt)

    Parameters

    value

    The boolean value.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a Date object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setDate:(nullable NSDate *)value atIndex:(NSUInteger)index;

    Swift

    func setDate(_ value: Date?, at index: UInt)

    Parameters

    value

    The Date object.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a CBLBlob object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setBlob:(nullable CBLBlob *)value atIndex:(NSUInteger)index;

    Swift

    func setBlob(_ value: CBLBlob?, at index: UInt)

    Parameters

    value

    The CBLBlob object.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a CBLArray object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setArray:(nullable CBLArray *)value atIndex:(NSUInteger)index;

    Swift

    func setArray(_ value: CBLArray?, at index: UInt)

    Parameters

    value

    The CBLArray object.

    index

    The index. This value must not exceed the bounds of the array.

  • Sets a CBLDictionary object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)setDictionary:(nullable CBLDictionary *)value atIndex:(NSUInteger)index;

    Swift

    func setDictionary(_ value: CBLDictionary?, at index: UInt)

    Parameters

    value

    The CBLDictionary object.

    index

    The index. This value must not exceed the bounds of the array.

  • Adds a value to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addValue:(nullable id)value;

    Swift

    func addValue(_ value: Any?)

    Parameters

    value

    The value.

  • Adds a String object to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addString:(nullable NSString *)value;

    Swift

    func add(_ value: String?)

    Parameters

    value

    The String object.

  • Adds an NSNumber object to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addNumber:(nullable NSNumber *)value;

    Swift

    func add(_ value: NSNumber?)

    Parameters

    value

    The NSNumber object.

  • Adds an integer value to the end of the array.

    Declaration

    Objective-C

    - (void)addInteger:(NSInteger)value;

    Swift

    func add(_ value: Int)

    Parameters

    value

    The integer value.

  • Adds a long long value to the end of the array.

    Declaration

    Objective-C

    - (void)addLongLong:(long long)value;

    Swift

    func addLongLong(_ value: Int64)

    Parameters

    value

    The long long value.

  • Adds a float value to the end of the array.

    Declaration

    Objective-C

    - (void)addFloat:(float)value;

    Swift

    func add(_ value: Float)

    Parameters

    value

    The float value.

  • Adds a double value to the end of the array.

    Declaration

    Objective-C

    - (void)addDouble:(double)value;

    Swift

    func add(_ value: Double)

    Parameters

    value

    The double value.

  • Adds a boolean value to the end of the array.

    Declaration

    Objective-C

    - (void)addBoolean:(BOOL)value;

    Swift

    func addBoolean(_ value: Bool)

    Parameters

    value

    The boolean value.

  • Adds a Date object to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addDate:(nullable NSDate *)value;

    Swift

    func add(_ value: Date?)

    Parameters

    value

    The Date object.

  • Adds a CBLBlob object to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addBlob:(nullable CBLBlob *)value;

    Swift

    func add(_ value: CBLBlob?)

    Parameters

    value

    The CBLMutableArray object.

  • Adds a CBLArray object to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addArray:(nullable CBLArray *)value;

    Swift

    func add(_ value: CBLArray?)

    Parameters

    value

    The CBLArray object.

  • Adds a CBLDictionary object to the end of the array. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)addDictionary:(nullable CBLDictionary *)value;

    Swift

    func add(_ value: CBLDictionary?)

    Parameters

    value

    The CBLDictionary object.

  • Inserts a value at the given index. A nil value will be converted to an NSNull. an NSNull object.

    Declaration

    Objective-C

    - (void)insertValue:(nullable id)value atIndex:(NSUInteger)index;

    Swift

    func insertValue(_ value: Any?, at index: UInt)

    Parameters

    value

    The value.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts an String object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)insertString:(nullable NSString *)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: String?, at index: UInt)

    Parameters

    value

    The String object.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts an NSNumber object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)insertNumber:(nullable NSNumber *)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: NSNumber?, at index: UInt)

    Parameters

    value

    The NSNumber object.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts an integer value at the given index.

    Declaration

    Objective-C

    - (void)insertInteger:(NSInteger)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: Int, at index: UInt)

    Parameters

    value

    The integer value.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a long long value at the given index.

    Declaration

    Objective-C

    - (void)insertLongLong:(long long)value atIndex:(NSUInteger)index;

    Swift

    func insertLongLong(_ value: Int64, at index: UInt)

    Parameters

    value

    The long long value.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a float value at the given index.

    Declaration

    Objective-C

    - (void)insertFloat:(float)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: Float, at index: UInt)

    Parameters

    value

    The float value.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a double value at the given index.

    Declaration

    Objective-C

    - (void)insertDouble:(double)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: Double, at index: UInt)

    Parameters

    value

    The double value.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a boolean value at the given index.

    Declaration

    Objective-C

    - (void)insertBoolean:(BOOL)value atIndex:(NSUInteger)index;

    Swift

    func insertBoolean(_ value: Bool, at index: UInt)

    Parameters

    value

    The boolean value.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a Date object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)insertDate:(nullable NSDate *)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: Date?, at index: UInt)

    Parameters

    value

    The Date object.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a CBLBlob object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)insertBlob:(nullable CBLBlob *)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: CBLBlob?, at index: UInt)

    Parameters

    value

    The CBLBlob object.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a CBLDictionary object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)insertDictionary:(nullable CBLDictionary *)value
                     atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: CBLDictionary?, at index: UInt)

    Parameters

    value

    The CBLDictionary object.

    index

    The index. This value must not exceed the bounds of the array.

  • Inserts a CBLArray object at the given index. A nil value will be converted to an NSNull.

    Declaration

    Objective-C

    - (void)insertArray:(nullable CBLArray *)value atIndex:(NSUInteger)index;

    Swift

    func insert(_ value: CBLArray?, at index: UInt)

    Parameters

    value

    The CBLArray object.

    index

    The index. This value must not exceed the bounds of the array.

  • Removes the object at the given index.

    Declaration

    Objective-C

    - (void)removeValueAtIndex:(NSUInteger)index;

    Swift

    func removeValue(at index: UInt)

    Parameters

    index

    The index. This value must not exceed the bounds of the array.

  • Gets a CBLMutableArray at the given index. Returns nil if the value is not an array.

    Declaration

    Objective-C

    - (nullable CBLMutableArray *)arrayAtIndex:(NSUInteger)index;

    Swift

    func atIndex(_ index: UInt) -> CBLMutableArray?

    Parameters

    index

    The index. This value must not exceed the bounds of the array.

    Return Value

    The CBLMutableArray object.

  • Gets a CBLMutableDictionary at the given index. Returns nil if the value is not a dictionary.

    Declaration

    Objective-C

    - (nullable CBLMutableDictionary *)dictionaryAtIndex:(NSUInteger)index;

    Swift

    func dictionary(at index: UInt) -> CBLMutableDictionary?

    Parameters

    index

    The index. This value must not exceed the bounds of the array.

    Return Value

    The CBLMutableDictionary object.

  • Set data for the array. 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

    - (void)setData:(nullable NSArray *)data;

    Swift

    func setData(_ data: [Any]?)

    Parameters

    data

    The data.

  • Subscripting access to a CBLMutableFragment object that represents the value at the given index.

    Declaration

    Objective-C

    - (nullable CBLMutableFragment *)objectAtIndexedSubscript:(NSUInteger)index;

    Swift

    subscript(index: UInt) -> CBLMutableFragment? { get }

    Parameters

    index

    The index. If the index value exceeds the bounds of the array, the CBLMutableFragment will represent a nil value.

    Return Value

    The CBLMutableFragment object.