Function

CFBagSetValue

Sets a value in a mutable bag.

Declaration

void CFBagSetValue(CFMutableBagRef theBag, const void *value);

Parameters

theBag

The bag in which value is to be set.

value

The value to be set in the collection. If this value already exists in theBag, it is replaced. You may pass the value itself instead of a pointer to it if the value is pointer-size or less. If theBag is fixed-size and the value is beyond its capacity, the behavior is undefined.

Discussion

Depending on the implementation of the equal callback specified when creating theBag, the value that is replaced by value may not have the same pointer equality.

See Also

Modifying a Mutable Bag

CFBagAddValue

Adds a value to a mutable bag.

CFBagRemoveAllValues

Removes all values from a mutable bag.

CFBagRemoveValue

Removes a value from a mutable bag.

CFBagReplaceValue

Replaces a value in a mutable bag.