Contents

initWithCapacity

Initializes an instance of OSData.

Declaration

virtual bool initWithCapacity(
 unsigned intcapacity);

Parameters

  • capacity:

    The initial capacity of the OSData object in bytes.

Return Value

true on success, false on failure.

Overview

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

capacity may be zero. The OSData object will allocate a buffer internally when necessary, and will grow as needed to accommodate more bytes (unlikeCFMutableData, for which a nonzero initial capacity is a hard limit).

See Also

Miscellaneous