---
title: "CFSetGetCountOfValue(_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfsetgetcountofvalue(_:_:)"
---

# CFSetGetCountOfValue(_:_:)

Returns the number of values in a set that match a given value.

## Declaration

```swift
func CFSetGetCountOfValue(_ theSet: CFSet!, _ value: UnsafeRawPointer!) -> CFIndex
```

## Parameters

- `theSet`: The set to examine.
- `value`: The value for which to search in theSet. Comparisons are made using the equal callback provided when theSet was created. If the equal callback was NULL, pointer equality (in C, ==) is used.

## Return Value

Return Value The number of times value occurs in theSet. By definition, sets can not contain duplicate values, so returns 1 if value is contained in theSet, otherwise 0.

## Discussion

Discussion This function uses the equal callback. value and all elements in the set must be understood by the equal callback.

## See Also

### Examining a Set

- [CFSetContainsValue(_:_:)](corefoundation/cfsetcontainsvalue(_:_:).md)
- [CFSetGetCount(_:)](corefoundation/cfsetgetcount(_:).md)
- [CFSetGetValue(_:_:)](corefoundation/cfsetgetvalue(_:_:).md)
- [CFSetGetValueIfPresent(_:_:_:)](corefoundation/cfsetgetvalueifpresent(_:_:_:).md)
- [CFSetGetValues(_:_:)](corefoundation/cfsetgetvalues(_:_:).md)
