Type Method

arrayWithContentsOfURL:

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

Declaration

+ (NSMutableArray<ObjectType> *)arrayWithContentsOfURL:(NSURL *)url;

Parameters

aURL

The location of the file containing a string representation of a mutable array produced by the writeToURL:atomically: method.

Return Value

A mutable array containing the contents specified by aURL. Returns nil if the location can’t be opened or if the contents of the location can’t be parsed into a mutable array.

Discussion

The array representation at the location identified by aURL must contain only property list objects (NSString, NSData, NSDate, NSNumber, NSArray, or NSDictionary objects). The objects contained by this array are immutable even if the array is mutable.

See Also

Creating and Initializing a Mutable Array

+ arrayWithCapacity:

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

+ arrayWithContentsOfFile:

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

- 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.