Type Property

preservesVersions

Returns whether the receiving subclass of NSDocument supports Versions.

Declaration

@property(class, readonly) BOOL preservesVersions;

Return Value

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

Discussion

The default implementation of this method returns [self autosavesInPlace]. You can override it and return NO to declare that NSDocument should not preserve old document versions.

Returning NO from this method disables version browsing and revertDocumentToSaved:, which rely on version preservation when autosaving in place. Returning YES from this method when autosavesInPlace returns NO will result in undefined behavior.

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.

autosavesInPlace

Returns whether the receiver supports autosaving in place.

autosavesDrafts

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

- 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.