当我将网站加载到我的可可应用程序的webview中时出现此问题。 我的问题描述:如何处理“太多的HTTP重定向”错误
错误域= NSURLErrorDomain代码= -1007 “HTTP重定向过多” 的UserInfo = {0x18d17d56 = NSErrorFailingURLStringKey URLHERE, NSErrorFailingURLKey = URLHERE,NSLocalizedDescription =太多的HTTP重定向 }
为什么这个错误出现
如何处理呢
我走了,虽然下面的链接,但简化版,帮我
Too many HTTP redirects
"too many HTTP redirects" while using Alamofire Upload Multipart Form Data
too many HTTP redirects, Google Drive, iOS SDK等等..
UPDATE:
- (NSURLRequest *)webView:(WebView *)sender resource:(id)identifier willSendRequest:(NSURLRequest *)request redirectResponse:(NSURLResponse *)redirectResponse fromDataSource:(WebDataSource *)dataSource {
if(redirectResponse)
{
if([redirectResponse.URL.absoluteString isEqualToString:self.webviewLoadingURL.absoluteString])
{
NSLog(@"both redirect and load url is same");
}
}
return request;
}
我越来越对的WebView重定向和负载相同的URL。