Skip to content

Instantly share code, notes, and snippets.

@rsaunders100
Last active August 29, 2015 14:21
Show Gist options
  • Save rsaunders100/282a18b7d54d479ba13d to your computer and use it in GitHub Desktop.
Save rsaunders100/282a18b7d54d479ba13d to your computer and use it in GitHub Desktop.
NSURL *url = [NSURL URLWithString:@"https://google.co.uk"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSError *error;
[NSURLConnection sendSynchronousRequest:request
returningResponse:nil
error:&error];
NSLog(@"NSURLConnection error: %@", error.localizedDescription);
[[[NSURLSession sharedSession]
dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *res, NSError *error) {
NSLog(@"NSURLSession error: %@", error.localizedDescription);
}] resume];
@rsaunders100
Copy link
Author

Demonstrating a bug in iOS 8.1 & 8.2 (fixed in 8.3)
http://www.rsaunders.co.uk/2015/05/network-errors-are-unlocalised-in-ios.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment