openDocumentWithContentsOfURL:display:error:
Opens a document located by the given URL presents its user interface if requested, and returns the document if successful.
Declaration
- (id) openDocumentWithContentsOfURL:(NSURL *) url display:(BOOL) displayDocument error:(NSError **) outError;Discussion
If not successful, the method returns nil after setting outError to point to an NSError object that encapsulates the reason why the document could not be opened.
The default implementation of this method checks to see if the document is already open according to document(for:), and if it is not open determines the type of the document, calls makeDocument(withContentsOf:ofType:) to instantiate it, then calls addDocument(_:) to record its opening, and sends the document makeWindowControllers() and showWindows() messages if displayDocument is true. If the document is already open it is just sent a showWindows() message if displayDocument is true.
See Also
Deprecated Methods
documentForFileName:fileExtensionsFromType:fileNamesFromRunningOpenPanelmakeUntitledDocumentOfType:makeDocumentWithContentsOfURL:ofType:makeDocumentWithContentsOfFile:ofType:openDocumentWithContentsOfFile:display:openDocumentWithContentsOfURL:display:openUntitledDocumentOfType:display:reopenDocumentForURL:withContentsOfURL:error:setShouldCreateUI:shouldCreateUItypeFromFileExtension: