Writes the contents of the receiver to the file specified by a given path.
- iOS 2.0–2.0Deprecated
- macOS 10.0–10.4Deprecated
- tvOS 9.0–9.0Deprecated
- watchOS 2.0–2.0Deprecated
true if the file is written successfully, otherwise
Writes the contents of the receiver to the file specified by
path (overwriting any existing file at
path is written in the default C-string encoding if possible (that is, if no information would be lost), in the Unicode encoding otherwise.
true, the receiver is written to an auxiliary file, and then the auxiliary file is renamed to
false, the receiver is written directly to
true option guarantees that
path, if it exists at all, won’t be corrupted even if the system should crash during writing.
path contains a tilde (
~) character, you must expand it with
expanding before invoking this method.