Contents

makeUntitledDocument(ofType:)

Instantiates a new untitled document of the specified type and returns it if successful.

Declaration

func makeUntitledDocument(ofType typeName: String) throws -> NSDocument

Parameters

  • typeName:

    The type of the document.

Discussion

The document type is specified by typeName. If not successful, the method returns nil after setting outError to point to an NSError object that encapsulates the reason why a new untitled document could not be instantiated. The default implementation of this method calls documentClass(forType:) to find out the class of document to instantiate, then allocates and initializes a document by sending it init(type:).

See Also

Creating and Opening Documents