iosobjective-cxcodeuiwebview

NSURLConnection finished with error - 1001


First, the url is unreachable, When the webview called loadRequest, it has two error messages.And the UIWebViewDelegate didFailLoadWithError couldn't be called.

NSURLConnection finished with error - code -1001

HTTP load failed (error code: -999 [1:89])

 NSURLRequest *request =[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://ip:port/index"] cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:5];

[self.webView loadRequest:request];

Solution

  • I didn't set webView.delegate, so the delegates didn't be called