Instance Method

fileManager:shouldMoveItemAtURL:toURL:

Asks the delegate if the file manager should move the specified item to the new URL.

Declaration

- (BOOL)fileManager:(NSFileManager *)fileManager shouldMoveItemAtURL:(NSURL *)srcURL toURL:(NSURL *)dstURL;

Parameters

fileManager

The file manager object that is attempting to move the file or directory.

srcURL

The URL of the file or directory that the file manager wants to move.

dstURL

The URL specifying the new location for the file or directory.

Return Value

YES if the item should be moved or NO if it should not be moved. If you do not implement this method, the file manager assumes a response of YES.

Discussion

This method is called only once for the item being moved, regardless of whether the item is a file, directory, or symbolic link.

This method performs the same task as the fileManager:shouldMoveItemAtPath:toPath: method and is preferred over that method in macOS 10.6 and later.

See Also

Moving an Item

- fileManager:shouldMoveItemAtPath:toPath:

Asks the delegate if the file manager should move the specified item to the new path.

- fileManager:shouldProceedAfterError:movingItemAtURL:toURL:

Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified URL.

- fileManager:shouldProceedAfterError:movingItemAtPath:toPath:

Asks the delegate if the move operation should continue after an error occurs while moving the item at the specified path.