init(contentsOfFile:)
Initializes a newly allocated array with the contents of the file specified by a given path.
Declaration
convenience init?(contentsOfFile path: String)Parameters
- path:
The path to a file containing a representation of an array produced by the Write(tofile:atomically:) method.
Return Value
An array initialized to contain the contents of the file specified by aPath or nil if the file can’t be opened or the contents of the file can’t be parsed into an array. The returned object might be different than the original receiver.
Discussion
The array representation in the file identified by aPath must contain only property list objects (NSString, NSData, NSArray, or NSDictionary objects). The objects contained by this array are immutable, even if the array is mutable.