Instance Method

changeCountTokenForSaveOperation:

Returns an object that encapsulates the current record of document changes at the beginning of a save operation.

Declaration

- (id)changeCountTokenForSaveOperation:(NSSaveOperationType)saveOperation;

Parameters

saveOperation

The type of save operation.

Return Value

An object encapsulating the document changes.

Discussion

The returned object is meant to be passed to updateChangeCountWithToken:forSaveOperation: at the end of the save operation. For example, saveToURL:ofType:forSaveOperation:completionHandler: invokes this method, on the main thread, before it does any actual saving. This method facilitates asynchronous saving, during which a user can change a document while it is being saved.

See Also

Reading From and Writing to URLs

- readFromURL:ofType:error:

Sets the contents of this document by reading from a file or file package, of a specified type, located by a URL.

- writeToURL:ofType:error:

Writes the contents of the document to a file or file package located by a URL, formatted to a specified type.

- writeSafelyToURL:ofType:forSaveOperation:error:

Writes the contents of the document to a file or file package located by a URL.

- writeToURL:ofType:forSaveOperation:originalContentsURL:error:

Writes the contents of the document to a file or file package located by a URL.

- fileAttributesToWriteToURL:ofType:forSaveOperation:originalContentsURL:error:

As a file is being saved, returns the attributes that should be written to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation.

- saveToURL:ofType:forSaveOperation:delegate:didSaveSelector:contextInfo:

Saves the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation.

- canAsynchronouslyWriteToURL:ofType:forSaveOperation:

Returns whether the receiver can concurrently write to a file or file package located by a URL, formatted for a specific type, for a specific kind of save operation.

- saveToURL:ofType:forSaveOperation:completionHandler:

Saves the contents of the document to a file or file package located by a URL, formatted to a specified type, for a particular kind of save operation, and invokes the passed-in completion handler.

- updateChangeCountWithToken:forSaveOperation:

Records the fact that saving has succeeded and updates related aspects of the change count mechanism.

- unblockUserInteraction

Unblocks the main thread during asynchronous saving.