write(to:atomically:)
Writes the contents of the array to the location specified by a given URL.
Declaration
func write(to url: URL, atomically: Bool) -> BoolParameters
- url:
The location at which to write the array.
- atomically:
If True, the array is written to an auxiliary location, and then the auxiliary location is renamed to
aURL. If False, the array is written directly toaURL. The True option guarantees thataURL, if it exists at all, won’t be corrupted even if the system should crash during writing.
Return Value
true if the location is written successfully, otherwise false.
Discussion
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 NSArray/init(contentsOfURL:)-fk8x or the instance method NSArray/init(contentsOfURL:)-5lo2y.