當我將網站加載到我的可可應用程序的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。