Function

CFArraySetValueAtIndex

Changes the value at a given index in an array.

Declaration

void CFArraySetValueAtIndex(CFMutableArrayRef theArray, CFIndex idx, const void *value);

Parameters

theArray

The array in which the value is to be changed.

idx

The index at which to set the new value. The value must not lie outside the index space of theArray (0 to N-1 inclusive, where N is the count of the array before the operation).

value

The value to set in theArray. The value is retained by theArray using the retain callback provided when theArray was created and the previous value at idx is released. If the value is not of the type expected by the retain callback, the behavior is undefined. The indices of other values are not affected.

See Also

CFMutableArray Miscellaneous Functions

CFArrayAppendArray

Adds the values from one array to another array.

CFArrayAppendValue

Adds a value to an array giving it the new largest index.

CFArrayCreateMutable

Creates a new empty mutable array.

CFArrayCreateMutableCopy

Creates a new mutable array with the values from another array.

CFArrayExchangeValuesAtIndices

Exchanges the values at two indices of an array.

CFArrayInsertValueAtIndex

Inserts a value into an array at a given index.

CFArrayRemoveAllValues

Removes all the values from an array, making it empty.

CFArrayRemoveValueAtIndex

Removes the value at a given index from an array.

CFArrayReplaceValues

Replaces a range of values in an array.

CFArraySortValues

Sorts the values in an array using a given comparison function.