CFDictionarySetValue

Header: CFDictionary.h Carbon status: Supported

Sets the value of the key in the dictionary.

void CFDictionarySetValue (
    CFMutableDictionaryRef dict, 
    const void *key, 
    const void *value
);
Parameter descriptions
dict

The dictionary to which the value is to be set. If this parameter is not a valid mutable CFDictionary, the behavior is undefined. If the dictionary is a fixed-capacity dictionary and it is full before this operation, and the key does not exist in the dictionary, the behavior is undefined.

key

The key of the value to set into the dictionary. If a key which matches this key is already present in the dictionary, only the value is changed ("add if absent, replace if present"). If no key matches the given key, the key-value pair is added to the dictionary. If added, the key is retained by the dictionary, using the retain callback provided when the dictionary was created. If the key is not of the sort expected by the key retain callback, the behavior is undefined.

value

The value to add to or replace into the dictionary. The value is retained by the dictionary using the retain callback provided when the dictionary was created, and the previous value if any is released. If the value is not of the sort expected by the retain or release callbacks, the behavior is undefined.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)