Writes the contents of the document to a file or file package located by a URL.
- macOS 10.4+
The location to which the document contents are written.
The string that identifies the document type.
The type of save operation.
The location of the previously saved copy of the document (if not
On return, if the document contents could not be written, a pointer to an error object that encapsulates the reason they could not be written.
YES if the document contents could be written; otherwise,
The default implementation of this method merely invokes
[self write. You can override this method instead of one of the three simple writing methods (
data) if your document writing machinery needs access to the on-disk representation of the document revision that is about to be overwritten. The value of
absolute is often not the same as
[self file. Other times it is not the same as the URL for the final save destination. Likewise,
absolute is often not the same value as
[self file. If
nil, either the document has never been saved or the user deleted the document file since it was opened.
For backward binary compatibility with OS X v10.3 and earlier, if
write is overridden and both URLs use the
file: scheme, the default implementation of this method instead invokes:
The save operation used in this case is never
NSSave is used instead.