Creates a new document whose contents are the same as the receiver and returns an error object if unsuccessful.
- macOS 10.7+
On return, if the document could not be duplicated, a pointer to an error object that encapsulates the reason why it could not be duplicated.
The new document if duplication is successful; otherwise
The new document returned doesn’t yet have a value to return from
The default implementation of this method first uses
write to write the document’s current contents to a file located in the same directory that is used for the autosaved contents of untitled documents and with the same sort of name, then invokes
You can override this method to customize what is done during document duplication, but if your override does not invoke
[NSDocument you must take care to do things that that method does, especially invoking