CFBagCreateMutableCopy(_:_:_:)
Creates a new mutable bag with the values from another bag.
Declaration
func CFBagCreateMutableCopy(_ allocator: CFAllocator!, _ capacity: CFIndex, _ theBag: CFBag!) -> CFMutableBag!Parameters
- allocator:
The allocator to use to allocate memory for the new bag and its storage for values. Pass
NULLor kCFAllocatorDefault to use the current default allocator. - capacity:
The maximum number of values that can be contained by the new bag. The bag starts with the same count as
theBag, and can grow to this number of values (and it can have less). If this value is0, the bag’s maximum capacity is not limited. This value must be greater than or equal to the count oftheBag, and must not be negative. - theBag:
The bag to copy. The pointer values from
theBagare copied into the new bag. However, the values are also retained by the new bag. The count of the new bag is the same as the count oftheBag. The new bag uses the same callbacks astheBag.
Return Value
A new mutable bag that contains the same values as theBag. Ownership follows the The Create Rule.