2016-11-01 2 views
0

내 WebView를 처음로드 할 때 오류가 발생합니다.WebView로드가 실패했습니다.

오류 도메인 = NSURLErrorDomain 코드 = -999 "(널)" 사용자 정보 = {NSErrorFailingURLStringKey = http://v.qq.com/iframe/player.html?vid=k034117nqr8&tiny=0&auto=0, NSErrorFailingURLKey = http://v.qq.com/iframe/player.html?vid=k034117nqr8&tiny=0&auto=0

하지만 난 내 tabview을 스크롤 할 때, 내 웹보기가 새로 고침 될 것입니다, 그때 그것은로드 요청 성공 일 것입니다. 왜요? 누가 그것을 압니까?

+1

의 사용 가능한 복제 [무엇 아이폰 OS에 NSURLErrorCancelled = -999입니까?] (http://stackoverflow.com/questions/25390073/what-is-nsurlerrorcancelled-999-in-ios) – jcesarmobile

답변

0

나는 url.Then에서 인수를 추가 할 때마다 다른 URL을 요청할 때마다 문제를 해결합니다.

UIWebView *webView = [self createWebView]; 
webView.delegate = self; 

NSURLComponents *urlCom = [[NSURLComponents alloc] initWithString:self.content]; 
NSString *timeString = [NSString stringWithFormat:@"%f",[[NSDate date] timeIntervalSince1970]]; 
NSURLQueryItem *item = [[NSURLQueryItem alloc] initWithName:@"aaa" value:timeString]; 
NSMutableArray *array = [urlCom.queryItems mutableCopy]; 
[array addObject:item]; 
urlCom.queryItems = array; 
[webView loadRequest:[NSURLRequest requestWithURL:[urlCom URL]]]; 
관련 문제