Instance Method


Writes the contents of the array to the location specified by a given URL.


- (BOOL)writeToURL:(NSURL *)url atomically:(BOOL)atomically;



The location at which to write the array.


If YES, the array is written to an auxiliary location, and then the auxiliary location is renamed to aURL. If NO, the array is written directly to aURL. The YES option guarantees that aURL, if it exists at all, won’t be corrupted even if the system should crash during writing.

Return Value

YES if the location is written successfully, otherwise NO.


If the array’s contents are all property list objects (NSString, NSData, NSArray, or NSDictionary objects), the location written by this method can be used to initialize a new array with the class method arrayWithContentsOfURL: or the instance method initWithContentsOfURL:.

See Also

Storing Arrays

- writeToFile:atomically:

Writes the contents of the array to a file at a given path.