<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFSetAddValue(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFSetAddValue"
  },
  "title" : "CFSetAddValue(_:_:)"
}
-->

# CFSetAddValue(_:_:)

Adds a value to a CFMutableSet object.

```
func CFSetAddValue(_ theSet: CFMutableSet!, _ value: UnsafeRawPointer!)
```

## Parameters

`theSet`

The set to modify.

`value`

A CFType object or a pointer value to add to `theSet` (or the value itself, if it fits into the size of a pointer).

    `value`     is retained by     `theSet`     using the retain callback provided when     `theSet`     was created. If     `value`     is not of the type expected by the retain callback, the behavior is undefined. If     `value`     already exists in the collection, this function returns without doing anything.

## Discussion

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)