Type Property

autosavesInPlace

Returns whether the receiver supports autosaving in place.

Declaration

@property(class, readonly) BOOL autosavesInPlace;

Return Value

YES if the receiver supports autosaving in place; NO otherwise.

Discussion

The default implementation of this method returns NO. You can override it and return YES to declare that your subclass of NSDocument can do autosaving in place. You should not invoke this method to find out whether autosaving in place is actually being done at any particular moment. You should instead use the NSSaveOperationType parameter that the system passes to your overrides of save and write methods.

AppKit invokes this method at a variety of times, and not always on the main thread. For example, autosaveWithImplicitCancellability:completionHandler: invokes this method as part of determining whether the autosaving will be performed in place (NSAutosaveInPlaceOperation) or in a separate autosave directory (NSAutosaveElsewhereOperation). As another example, the canCloseDocumentWithDelegate:shouldCloseSelector:contextInfo: method and the NSDocumentController machinery for handling unsaved changes at app termination time both invoke this method as part of determining whether alerts about unsaved changes should be presented to the user.

See Also

Autosaving

- checkAutosavingSafetyAndReturnError:

Returns a Boolean value indicating whether it is probably safe to autosave document changes.

- scheduleAutosaving

Schedules periodic autosaving for the purpose of crash protection.

hasUnautosavedChanges

A Boolean value indicating whether the document has changes that have not been autosaved.

- autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:

Autosaves the document’s contents at an appropriate location.

- autosaveWithImplicitCancellability:completionHandler:

Autosaves the document’s contents at an appropriate location if it needs autosaving.

autosavesDrafts

Returns whether the receiving subclass of NSDocument supports autosaving of drafts.

preservesVersions

Returns whether the receiving subclass of NSDocument supports Versions.

- browseDocumentVersions:

Opens the Versions browser in the document’s main window.

autosavingFileType

Returns the document type that should be used for an autosave operation.

autosavingIsImplicitlyCancellable

A Boolean value indicating whether autosaving is happening now but could be safely cancelled.

autosavedContentsFileURL

The location of the most recently autosaved document contents.