Instance Method

URLSession:task:didCompleteWithError:

Tells the delegate that the task finished transferring data.

Declaration

- (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didCompleteWithError:(NSError *)error;

Parameters

session

The session containing the task whose request finished transferring data.

task

The task whose request finished transferring data.

error

If an error occurred, an error object indicating how the transfer failed, otherwise NULL.

Discussion

Server errors are not reported through the error parameter. The only errors your delegate receives through the error parameter are client-side errors, such as being unable to resolve the hostname or connect to the host.