Instance Method

getCachedResponseForDataTask:completionHandler:

Gets the cached URL response for a data task, passing it to the provided completion handler.

Declaration

- (void)getCachedResponseForDataTask:(NSURLSessionDataTask *)dataTask completionHandler:(void (^)(NSCachedURLResponse *cachedResponse))completionHandler;

Parameters

dataTask

The data task whose cached URL response is desired.

completionHandler

A completion handler that receives the cached URL response for the data task's request, or nil if no response is found in the cache.

See Also

Getting and Storing Cached Objects

- cachedResponseForRequest:

Returns the cached URL response in the cache for the specified URL request.

- storeCachedResponse:forRequest:

Stores a cached URL response for a specified request.

- storeCachedResponse:forDataTask:

Stores a cached URL response for a specified data task.

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