Returns a requested value from a bag.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
const void * CFBagGetValue(CFBag Ref theBag, const void *value);
Parameters
theBag
The bag to examine.
value
The value for which to find matches in
the
. The equal callback provided whenBag the
was created is used to compare. If the equal callback wasBag NULL
, pointer equality (in C, ==) is used. Ifvalue
, or any other value inthe
, is not understood by the equal callback, the behavior is undefined.Bag
Return Value
A pointer to value
, or NULL
if value
is not in the
. If the value is a Core Foundation object, ownership follows the The Get Rule.
Discussion
Depending on the implementation of the equal callback specified when creating the
, the value returned may not have the same pointer equality as value
.