Instance Method

moveDocumentWithCompletionHandler:

Moves the document to a user-selected location.

Declaration

- (void)moveDocumentWithCompletionHandler:(void (^)(BOOL didMove))completionHandler;

Parameters

completionHandler

The completion handler block object passed in to be invoked after moving is completed, regardless of success, failure, or cancellation of moving action.

Discussion

This method presents the user with a move panel if [self fileURL] is non-nil and then tries to save the document to the new location by invoking the moveToURL:completionHandler: method if the user accepts the location presented by the panel. If a file with the same name already exists at that location, the user will be asked to choose between replacing the pre-existing file, renaming the current document, or canceling the move process. If [self fileURL] is nil, then the [self runModalSavePanelForSaveOperation:NSSaveAsOperation delegate:didSaveSelector:contextInfo:] message is sent instead.

See Also

Moving Documents

- moveDocument:

Moves the document to a new location in response to the user choosing the Move To… menu item.

- moveToURL:completionHandler:

Moves the document’s file to the given URL.