0

Im trying to download a file using NSURLConnection I've prepared the url request, delegate methods, etc. I also set the timeout to 15.0 and I'm triggering the download on main thread with a code like this:

NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:urlRequest delegate:self];
[connection start];

This code works just fine but in case of no response from server there is no callback to delegate method for errors.

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

Regards

Abcd Efg
  • 2,146
  • 23
  • 41

1 Answers1

0

Check out this documentation, this will help you find a better way: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html#//apple_ref/doc/uid/20001836-BAJEAIEE

rshahriar
  • 2,440
  • 1
  • 15
  • 5