I don’t understand the syntax below at all.
“There are three messages that BNRLogger will need to respond to as the delegate of the NSURLConnection. Two are from the NSURLConnectionDataDelegate protocol:
- (void)connection:(NSURLConnection *)connection
didReceiveData:(NSData *)data;
-(void)connectionDidFinishLoading:(NSURLConnection *)connection;
The other is from the NSURLConnectionDelegate protocol:
-(void)connection:(NSURLConnection *)connection
didFailWithError:(NSError *)error;
I looked this up in the docs and it’s function signature looked like this:
func connection(NSURLConnection, didReceive: URLResponse)
Does this mean that connectionDidFinishLoading is from NSURLConnectionDataDelegate AND is a function that takes didReceiveData also from NSURLConnectionDataDelegate along with a function from NSURLConnectionDelegate called didFailWithError ?
connection(
NSURLConnectionDataDelegate::didReceiveData,
NSURLConnectionDataDelegate::connectionDidFinishLoading,
NSURLConnectionDelegate::didFailWithError
)
??
What does it mean when a method is under another one?
- (void)connection:(NSURLConnection *)connection
didReceiveData:(NSData *)data;