Creates a CFMutableData object by copying another CFData object.


func CFDataCreateMutableCopy(_ allocator: CFAllocator!, _ capacity: CFIndex, _ theData: CFData!) -> CFMutableData!



The CFAllocator object to be used to allocate memory for the new object. Pass NULL or kCFAllocatorDefault to use the current default allocator.


The maximum number of bytes that the CFData object can contain. The CFData object starts with the same length as the original object, and can grow to contain this number of bytes.

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


The CFData object to be copied.

Return Value

A CFMutableData object that has the same contents as the original object. Returns NULL if there was a problem copying the object. Ownership follows the The Create Rule.

See Also

Creating a Mutable Data Object