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.