Creates an immutable bag with the values of another bag.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
CFBag Ref CFBagCreateCopy(CFAllocator Ref allocator, CFBag Ref theBag);
Parameters
allocator
The allocator to use to allocate memory for the new bag and its storage for values. Pass
NULL
or kCFAllocatorDefault to use the current default allocator.theBag
The bag to copy. The pointer values from
the
are 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 ofBag the
. The new bag uses the same callbacks asBag the
.Bag
Return Value
A new bag that contains the same values as the
, or NULL
if there was a problem creating the object. Ownership follows the The Create Rule.