Starts downloading (if necessary) the specified item to the local system.
- iOS 5.0+
- macOS 10.7+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The URL for the file or directory in the cloud that you want to download.
On input, a pointer to variable for an
NSErrorobject. If an error occurs, this pointer is set to an
NSErrorobject containing information about the error. You may specify
nilto ignore the error information.
YES if the download started successfully or was not necessary, otherwise
NO is returned and
error is not
NSError object describing the error is returned in that parameter.
If a cloud-based file or directory has not been downloaded yet, calling this method starts the download process. If the item exists locally, calling this method synchronizes the local copy with the version in the cloud.
For a given URL, you can determine if a file is downloaded by getting the value of the
NSMetadata key. You can also use related keys to determine the current progress in downloading the file.