Returns the number of values in a set that match a given value.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
Parameters
theSet
The set to examine.
value
The value for which to search in
the
. Comparisons are made using the equal callback provided whenSet the
was created. If the equal callback wasSet NULL
, pointer equality (in C, ==) is used.
Return Value
The number of times value
occurs in the
. By definition, sets can not contain duplicate values, so returns 1
if value
is contained in the
, otherwise 0
.
Discussion
This function uses the equal callback. value
and all elements in the set must be understood by the equal callback.