Type Property

autosavesDrafts

Returns whether the document subclass supports autosaving of drafts.

Declaration

@property(class, readonly) BOOL autosavesDrafts;

Return Value

YES if the receiving subclass of NSDocument supports autosaving of drafts; otherwise NO.

Discussion

The system expects that an NSDocument subclass that returns YES from this method can properly handle save operations that use the NSAutosaveAsOperation save operation type.

The default implementation of this method returns YES for apps linked on or after OS X v10.8, and returns no for apps linked against earlier versions of macOS.

To opt out of autosaving in your NSDocument subclass when linking on or after OS X v10.8, override this method to return NO.

When linking against a macOS version prior to 10.8, you can declare that your NSDocument subclass supports autosaving by overriding this method to return YES.

AppKit invokes this method at various times. For example, when the updateChangeCount: method is called with NSChangeDone but without the NSChangeDiscardable change type, NSDocument will the next autosave to use NSAutosaveAsOperation and return the document into a draft.

Do not invoke this method to find out whether autosaving of a draft will be done.

See Also

Configuring the Autosave Behavior

autosavesInPlace

Returns whether the receiver supports autosaving in place.

preservesVersions

Returns whether the document subclass supports version management.

autosavedContentsFileURL

The location of the most recently autosaved document contents.

autosavingFileType

Returns the document type to use for an autosave operation.

autosavingIsImplicitlyCancellable

Returns a Boolean value that indicates whether you can cancel an in-progress autosave operation.