---
title: "CFSetCreateMutable(_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfsetcreatemutable(_:_:_:)"
---

# CFSetCreateMutable(_:_:_:)

Creates an empty CFMutableSet object.

## Declaration

```swift
func CFSetCreateMutable(_ allocator: CFAllocator!, _ capacity: CFIndex, _ callBacks: UnsafePointer<CFSetCallBacks>!) -> CFMutableSet!
```

## Parameters

- `allocator`: The allocator to use to allocate memory for the new set and its storage for values. Pass NULL or doc://com.apple.corefoundation/documentation/CoreFoundation/kCFAllocatorDefault to use the current default allocator.
- `capacity`: The maximum number of values that can be contained by the new set. The set starts empty and can grow to this number of values (and it can have less). Pass 0 to specify that the maximum capacity is not limited. The value must not be negative.
- `callBacks`: A pointer to a doc://com.apple.corefoundation/documentation/CoreFoundation/CFSetCallBacks structure initialized with the callbacks to use to retain, release, describe, and compare values in the set. A copy of the contents of the callbacks structure is made, so that a pointer to a structure on the stack can be passed in or can be reused for multiple collection creations. This parameter may be NULL, which is treated as if a valid structure of version 0 with all fields NULL had been passed in. If any of the fields are not valid pointers to functions of the correct type, or this parameter is not a valid pointer to a CFSetCallBacks structure, the behavior is undefined. If any value put into the collection is not one understood by one of the callback functions, the behavior when that callback function is used is undefined. If the collection contains CFType objects only, then pass doc://com.apple.corefoundation/documentation/CoreFoundation/kCFTypeSetCallBacks as this parameter to use the default callback functions.

## Return Value

Return Value A new mutable set, or NULL if there was a problem creating the object. Ownership follows the The Create Rule.

## See Also

### CFMutableSet Miscellaneous Functions

- [CFSetAddValue(_:_:)](corefoundation/cfsetaddvalue(_:_:).md)
- [CFSetCreateMutableCopy(_:_:_:)](corefoundation/cfsetcreatemutablecopy(_:_:_:).md)
- [CFSetRemoveAllValues(_:)](corefoundation/cfsetremoveallvalues(_:).md)
- [CFSetRemoveValue(_:_:)](corefoundation/cfsetremovevalue(_:_:).md)
- [CFSetReplaceValue(_:_:)](corefoundation/cfsetreplacevalue(_:_:).md)
- [CFSetSetValue(_:_:)](corefoundation/cfsetsetvalue(_:_:).md)
