Contents

initWithObjects

Initializes a new OSArray populated with objects provided.

Declaration

virtual bool initWithObjects( 
 const OSObject *objects[], 
 unsigned int count, 
 unsigned int capacity = 0);

Parameters

  • objects:

    A C array of OSObject-derived objects.

  • count:

    The number of objects to be placed into the array.

  • capacity:

    The initial storage capacity of the array object. If 0, count is used; otherwise this value must be greater than or equal to count.

Return Value

true on success, false on failure.

Overview

Not for general use. Use the static instance creation method withObjects instead.

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