Reopens a document, optionally located by a URL, by reading the contents for the document from another URL, optionally presents its user interface, and calls the passed-in completion handler.
- macOS 10.7+
The URL locating the reopened document, unless
nilparameter value indicates that the reopened document is to have no
file, like an untitled document.
The URL (which may or may not be different from the URL of the reopened document) of the document from which the contents are read.
true, displays the document’s user interface.
The completion handler block object passed in to be called at some point in the future, perhaps after the method invocation has returned. The completion handler must be called on the main thread.
The block takes three arguments:
The document that was opened, if successful. Otherwise,
Was Already Open
Whether the document was already open or being opened when this method was called.
If not successful, an
NSErrorobject that encapsulates the reason why the document could not be opened.
The default implementation of this method is very similar to
open, the primary difference being that it calls
make instead of
You can override this method to customize how documents are reopened during application launching by the restorable state mechanism introduced in OS X v10.7. Its implementation, however, is somewhat complex, so you should generally investigate overriding one of the methods that it calls instead. However, you can override this method to do additional work before calling the underlying method on
super. You can also call the underlying method on
super with a custom completion handler that performs additional work before calling the original completion handler.
Applications probably do not need to call this method directly.
For backward binary compatibility with OS X v10.6 and earlier, the default implementation of this method calls
[self reopen if that method is overridden and this one is not, instead of calling
make and all the rest.