Objective C Unsure where method is being called? <p>Showing what a novice I am with Objective C here. The second of these two methods is getting called by the method above. Though I have absolutely no idea where? I want to be able to wrap the part that calls the second method in an if statement to determine if the file did exist based on the returned Boolean. Example code would be appreciated, if anyone could also explain how this second method gets called that would also be fantastic.</p> <pre><code>-(void) queryResponseForURL:(NSURL *)inURL { NSMutableURLRequest * request = [NSMutableURLRequest requestWithURL:inURL]; [request setHTTPMethod:@"HEAD"]; NSURLConnection * connection = [NSURLConnection connectionWithRequest:request delegate:self]; // connection starts automatically } -(BOOL)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response{ if([(NSHTTPURLResponse *)response statusCode] == 200){ NSLog(@"file exists"); return YES; }else return NO; } </code></pre>