Type Method

arrayWithCapacity:

Creates and returns an NSMutableArray object with enough allocated memory to initially hold a given number of objects.

Declaration

+ (instancetype)arrayWithCapacity:(NSUInteger)numItems;

Parameters

numItems

The initial capacity of the new array.

Return Value

A new NSMutableArray object with enough allocated memory to hold numItems objects.

Discussion

Mutable arrays expand as needed; numItems simply establishes the object’s initial capacity.

See Also

Creating and Initializing a Mutable Array

+ arrayWithContentsOfFile:

Creates and returns a mutable array containing the contents of the file specified by the given path.

+ arrayWithContentsOfURL:

Creates and returns a mutable array containing the contents specified by a given URL.

- init

Initializes a newly allocated array.

- initWithCapacity:

Returns an array, initialized with enough memory to initially hold a given number of objects.

- initWithContentsOfFile:

Initializes a newly allocated mutable array with the contents of the file specified by a given path

- initWithContentsOfURL:

Initialized a newly allocated mutable array with the contents of the location specified by a given URL.