withObjects
Creates and initializes an OSArray populated with objects provided.
Declaration
static OSArray * withObjects(
const OSObject *objects[],
unsigned int count,
unsigned int capacity = 0);Parameters
- objects:
A C array of OSObject-derived instances.
- count:
The number of objects to be placed into the array.
- capacity:
The initial storage capacity of the array object. If 0,
countis used; otherwise this value must be greater than or equal tocount.
Return Value
An instance of OSArray containing the objects provided, with a retain count of 1; NULL on failure.
Overview
objects must be non-NULL, and count must be nonzero. If capacity is nonzero, it must be greater than or equal to count. The new array will grow as needed to accommodate more objects (unlikeCFMutableArray, for which the initial capacity is a hard limit).
See Also
Miscellaneous
copyCollectionensureCapacityflushCollectionfreegetCapacitygetCapacityIncrementgetCountgetLastObjectgetNextIndexOfObjectgetObjectinitWithArrayinitWithCapacityinitWithObjectsisEqualTo(const OSArray *)isEqualTo(const OSMetaClassBase *)mergeremoveObjectreplaceObjectserializesetCapacityIncrementsetObject(const OSMetaClassBase *)setObject(unsigned int, const OSMetaClassBase *)withArraywithCapacity