Class

NSURLSessionDownloadTask

A URL session task that stores downloaded data to file.

Overview

An NSURLSessionDownloadTask is a concrete subclass of NSURLSessionTask. Most of the methods associated with this class are documented in NSURLSessionTask.

Download tasks directly write the server’s response data to a temporary file, providing your app with progress updates as data arrives from the server. When you use download tasks in background sessions, these downloads continue even when your app is suspended or is otherwise not running.

You can pause (cancel) download tasks and resume them later (assuming the server supports doing so). You can also resume downloads that failed because of network connectivity problems.

When you use download tasks:

Topics

Canceling a Download

cancelByProducingResumeData:

Cancels a download and calls a callback with resume data for later use.

Relationships

Inherits From

See Also

Adding Download Tasks to a Session

downloadTaskWithURL:

Creates a download task that retrieves the contents of the specified URL and saves the results to a file.

downloadTaskWithURL:completionHandler:

Creates a download task that retrieves the contents of the specified URL, saves the results to a file, and calls a handler upon completion.

downloadTaskWithRequest:

Creates a download task that retrieves the contents of a URL based on the specified URL request object and saves the results to a file.

downloadTaskWithRequest:completionHandler:

Creates a download task that retrieves the contents of a URL based on the specified URL request object, saves the results to a file, and calls a handler upon completion.

downloadTaskWithResumeData:

Creates a download task to resume a previously canceled or failed download.

downloadTaskWithResumeData:completionHandler:

Creates a download task to resume a previously canceled or failed download and calls a handler upon completion.

NSURLSessionDownloadDelegate

The NSURLSessionDownloadDelegate protocol defines delegate methods that you should implement when using NSURLSession download tasks.