Contents

defaultDraftName()

Returns the default draft name for the document subclass.

Declaration

func defaultDraftName() -> String

Discussion

The default implementation of this method returns the string “Untitled”, as adjusted according to the user’s specified locale. Your app should typically return a name that describes the kind of document. For example, a spreadsheet app could return “Spreadsheet”. A document created from a template could return the name of the template, for example, “Résumé”.

When a document has not yet been assigned a name, and has not yet been autosaved with the NSDocument.SaveOperationType.autosaveAsOperation save operation type, the document bases the default name on the value in the displayName property.

If there is a already another document or file in the same place and with the same name as would be returned by this method, NSDocument appends a number to the defaultDraftName() string.

See Also

Managing Document Windows