Instance Method

autosaveDocumentWithDelegate:didAutosaveSelector:contextInfo:

Autosaves the document’s contents at an appropriate location.

Declaration

- (void)autosaveDocumentWithDelegate:(id)delegate didAutosaveSelector:(SEL)didAutosaveSelector contextInfo:(void *)contextInfo;

Parameters

delegate

The delegate to which the selector message is sent.

didAutosaveSelector

The selector of the message sent to the delegate.

contextInfo

Object passed with the callback to provide any additional context information.

Discussion

After autosaving, sends the message selected by didAutosaveSelector to the delegate, with contextInfo as the last argument. The method selected by didAutosaveSelector must have the same signature as:

- (void)document:(NSDocument *)document didAutosave:(BOOL)didAutosaveSuccessfully contextInfo:(void *)contextInfo

If an error occurs while autosaving, the method reports it to the user before sending the delegate a succeeded:NO message.

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.

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

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.