I want to log some errors generated when using a WebView. For instance:
- (void)webView:(UIWebView *)aWebView didFailLoadWithError:(NSError *)error{
NSString * domain;
domain = [error domain];
NSLog(@"%@",error);
if ( domain == NSURLErrorDomain ) {NSLog(@"log me");}
}
I found this does not work on Xcode 6.1 and iOS8.1-simulator. It used to work on previous iOS versions (tested with Xcode 6.1 and iOS7-simulator). What am I missing?
Here is the console output:
2014-11-06 03:42:15.295 MyApp debug[21897:3606481] Error Domain=NSURLErrorDomain Code=-1012 "The operation couldn’t be completed. (NSURLErrorDomain error -1012.)" UserInfo=0x7a7531c0 {NSErrorFailingURLKey=https://www.google.fr/}
And some debugging when using the iOS8-simulator:
(lldb) p NSURLErrorDomain (void *)
$0 = 0x0064dacc
(lldb) po domain
NSURLErrorDomain(lldb) p domain (NSString *) $2 = 0x0064dacc @"NSURLErrorDomain"