Contents

CFArrayInsertValueAtIndex(_:_:_:)

Inserts a value into an array at a given index.

Declaration

func CFArrayInsertValueAtIndex(_ theArray: CFMutableArray!, _ idx: CFIndex, _ value: UnsafeRawPointer!)

Parameters

  • theArray:

    The array into which value is inserted. If theArray is a fixed-capacity array and it is full before this operation, the behavior is undefined.

  • idx:

    The index at which to insert value. The index must be in the range 0 to N inclusive, where N is the count of theArray before the operation. If the index is the same as the count of theArray, this function has the same effect as Cfarrayappendvalue(_:_:).

  • value:

    The value to insert into theArray. The value is retained by theArray using the retain callback provided when theArray was created. If value is not of the type expected by the retain callback, the behavior is undefined.

Discussion

The value parameter is assigned to the index idx, and all values in theArray with equal and larger indices have their indices increased by one.

See Also

CFMutableArray Miscellaneous Functions