Writes the data object's bytes to the file specified by a given path.
- iOS 2.0+
- macOS 10.0+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
- watchOS 2.0+
The location to which to write the receiver's bytes. If
pathcontains a tilde (~) character, you must expand it with
stringbefore invoking this method.
By Expanding Tilde In Path
YES, the data is written to a backup file, and then—assuming no errors occur—the backup file is renamed to the name specified by
path; otherwise, the data is written directly to
YES if the operation succeeds, otherwise