Instance Method

connection:didWriteData:totalBytesWritten:expectedTotalBytes:

Sent to the delegate to deliver progress information for a download of a URL asset to a destination file.

Declaration

- (void)connection:(NSURLConnection *)connection didWriteData:(long long)bytesWritten totalBytesWritten:(long long)totalBytesWritten expectedTotalBytes:(long long)expectedTotalBytes;

Parameters

connection

The URL connection object downloading the asset.

bytesWritten

The number of bytes written since the last call of this method.

totalBytesWritten

The total number of bytes of the downloading asset that have been written to the file.

expectedTotalBytes

The total number of bytes of the URL asset once it is completely downloaded and written to a file. This parameter can be zero if the total number of bytes is not known.

Discussion

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.

See Also

Managing Downloads of URL Assets

- connectionDidResumeDownloading:totalBytesWritten:expectedTotalBytes:

Sent to the delegate when an URL connection resumes downloading a URL asset that was earlier suspended.

- connectionDidFinishDownloading:destinationURL:

Sent to the delegate when the URL connection has successfully downloaded the URL asset to a destination file.

Required.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software