Instance Method

initWithContentsOfURL:

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

Declaration

- (NSMutableArray<ObjectType> *)initWithContentsOfURL:(NSURL *)url;

Parameters

aURL

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

Return Value

A mutable array initialized to contain 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. The returned objects must be different than the original receiver.

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.

+ 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