Copies the item at the specified path to a new location synchronously.
- iOS 2.0+
- macOS 10.5+
- tvOS 9.0+
- watchOS 2.0+
The path to the file or directory you want to move. This parameter must not be
The path at which to place the copy of
src. This path must include the name of the file or directory in its new location. This parameter must not be
On input, a pointer to an error object. If an error occurs, this pointer is set to an actual error object containing the error information. You may specify
nilfor this parameter if you do not want the error information.
When copying items, the current process must have permission to read the file or directory at
src and write the parent directory of
dst. If the item at
src is a directory, this method copies the directory and all of its contents, including any hidden files. If a file with the same name already exists at
dst, this method stops the copy attempt and returns an appropriate error. If the last component of
src is a symbolic link, only the link is copied to the new path.
Prior to copying an item, the file manager asks its delegate if it should actually do so for each item. It does this by calling the
file method; if that method is not implemented it calls the
file method instead. If the delegate method returns
YES, or if the delegate does not implement the appropriate methods, the file manager copies the given file or directory. If there is an error copying an item, the file manager may also call the delegate’s
file method to determine how to proceed.