withObjects(const OSObject *, const OSString *, unsigned int, unsigned int)
Creates and initializes an OSDictionary populated with keys and objects provided.
Declaration
static OSDictionary * withObjects(
const OSObject *objects[],
const OSString *keys[],
unsigned int count,
unsigned int capacity = 0);Parameters
- objects:
A C array of OSMetaClassBase-derived objects.
- keys:
A C array of OSString keys for the corresponding objects in
objects. - count:
The number of keys and objects to be placed into the dictionary.
- capacity:
The initial storage capacity of the new dictionary object. If 0,
countis used; otherwise this value must be greater than or equal tocount.
Return Value
An instance of OSDictionary containing the key/object pairs provided, with a retain count of 1; NULL on failure.
Overview
objects and keys must be non-NULL, and count must be nonzero. If capacity is nonzero, it must be greater than or equal to count. The new dictionary will grow as needed to accommodate more key/object pairs (unlikeCFMutableDictionary, for which the initial capacity is a hard limit).
See Also
Miscellaneous
copyCollectionensureCapacityflushCollectionfreegetCapacitygetCapacityIncrementgetCountgetObjectgetObject(const OSString *)getObject(const OSSymbol *)initWithCapacityinitWithDictionaryinitWithObjects(const OSObject *, const OSString *, unsigned int, unsigned int)initWithObjects(const OSObject *, const OSSymbol *, unsigned int, unsigned int)isEqualToisEqualTo(const OSDictionary *)isEqualTo(const OSDictionary *, const OSCollection *)mergeremoveObjectremoveObject(const OSString *)removeObject(const OSSymbol *)serializesetCapacityIncrementsetObjectsetObject(const OSString *, const OSMetaClassBase *)setObject(const OSSymbol *, const OSMetaClassBase *)withCapacitywithDictionarywithObjects(const OSObject *, const OSSymbol *, unsigned int, unsigned int)