Protocol: NSURLConnectionDownloadDelegate
Overview
The NSURLConnectionDownloadDelegate protocol enables the delegate adopting the protocol to receive progress information about the download of a URL asset and, when downloading concludes, to get a file URL locating the downloaded file in the local file system.Sent to the delegate to deliver progress information for a download of a URL asset to a destination file.Sent to the delegate when the URL connection has successfully downloaded the URL asset to a destination file.Sent to the delegate when an URL connection resumes downloading a URL asset that was earlier suspended.
Instance Method Summary (collapse)
-
- connection:didWriteData:totalBytesWritten:expectedTotalBytes:
Sent to the delegate to deliver progress information for a download of a URL asset to a destination file.
-
- connectionDidFinishDownloading:destinationURL:
Sent to the delegate when the URL connection has successfully downloaded the URL asset to a destination file.
-
- connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes:
Sent to the delegate when an URL connection resumes downloading a URL asset that was earlier suspended.
Instance Method Details
- (Object) connection(connection, didWriteData:bytesWritten, totalBytesWritten:totalBytesWritten, expectedTotalBytes:expectedTotalBytes)
Sent to the delegate to deliver progress information for a download of a URL asset to a destination file. This method is invoked repeatedly during the download of a URL asset to the destination file. The delegate typically uses the values of the three “bytes” parameters to update a progress indicator in the application’s user interface.
- (Object) connectionDidFinishDownloading(connection, destinationURL:destinationURL)
Sent to the delegate when the URL connection has successfully downloaded the URL asset to a destination file. This method will be called once after a successful download. The file downloaded to destinationURL is guaranteed to exist there only for the duration of this method implementation; the delegate should copy or move the file to a more persistent and appropriate location.
- (Object) connectionDidResumeDownloading(connection, totalBytesWritten:totalBytesWritten, expectedTotalBytes:expectedTotalBytes)
Sent to the delegate when an URL connection resumes downloading a URL asset that was earlier suspended. This method is invoked once a suspended download of a URL asset resumes downloading. In response, the delegate can display a progress indicator, setting the initial value of the indicator to where it was when downloading was suspended. After the URL-connection object sends this message, it sends one or more connection:didWriteData:totalBytesWritten:expectedTotalBytes: to the delegate until the download concludes.