Saves the document.
- macOS 10.0+
The delegate to which the selector message is sent.
The selector of the message sent to the delegate.
Object passed with the callback to provide any additional context information.
NSDocument can be performed without further user intervention (at the very least, neither
nil), then the method immediately saves the document. Otherwise, it presents a Save panel to the user and saves the document if the user approves the panel. When saving has been completed or canceled, the method sends the message selected by
did to the
delegate, with the
context as the last argument.
As of OS X v10.5, this method checks to see if the document’s file has been modified since the document was opened or most recently saved or reverted, in addition to the checking for file moving, renaming, and trashing that it has done since OS X v10.1. When it senses file modification it presents an alert telling the user "This document’s file has been changed by another app since you opened or saved it,” giving them the choice of saving or not saving. For backward binary compatibility this is only done in apps linked against macOS 10.5 or later.
did callback method should have the following signature: