Mac Developer Library

Developer

Foundation Framework Reference NSURLConnectionDelegate Protocol Reference

Options
Deployment Target:

On This Page
Language:

NSURLConnectionDelegate

The NSURLConnectionDelegate protocol defines methods common to the NSURLConnectionDataDelegate and NSURLConnectionDownloadDelegate protocols. More...

Inheritance


Not Applicable

Import Statement


import Foundation @import Foundation;

Availability


Available in OS X v10.7 and later.
  • Sent when a connection fails to load its request successfully.

    Declaration

    Swift

    optional func connection(_ connection: NSURLConnection, didFailWithError error: NSError)

    Objective-C

    - (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error

    Parameters

    connection

    The connection sending the message.

    error

    An error object containing details of why the connection failed to load the request successfully.

    Discussion

    Once the delegate receives this message, it will receive no further messages for connection.

    Import Statement

    import Foundation

    Availability

    Available in OS X v10.2 and later.

    Available as part of an informal protocol prior to OS X v10.7.