Function

CFArrayCreateMutableCopy

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

Declaration

CFMutableArrayRef CFArrayCreateMutableCopy(CFAllocatorRef allocator, CFIndex capacity, CFArrayRef theArray);

Parameters

allocator

The allocator to use to allocate memory for the new array and its storage for values. Pass NULL or kCFAllocatorDefault to use the current default allocator.

capacity

The maximum number of values that can be contained by the new array. The array starts with the same number of values as theArray and can grow to this number of values (and it can have less).

Pass 0 to specify that the maximum capacity is not limited. If non-0, capacity must be greater than or equal to the count of theArray.

theArray

The array to copy. The pointer values from the array are copied into the new array. However, the values are also retained by the new array.

Return Value

A new mutable array that contains the same values as theArray. The new array has the same count as the theArray and uses the same callbacks. Ownership follows the The Create Rule.

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.

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.

CFArraySetValueAtIndex

Changes the value at a given index in an array.

CFArraySortValues

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software