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

Configuring the Autosave Behavior

autosavesDrafts

Returns whether the document subclass supports autosaving of drafts.

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.