2016-09-10 6 views
0

私は accounts.craigslist.org を接続するためにUIWebviewを使用しているが、それは動作しませんがconnnectすることはできません。 私はサイトアドレスをgoogleに変更するとwww.google.com となります。 私はプロキシを使用していますが、プロキシの問題ではないと思います。iPhoneのUIWebViewは、いくつかのサイト


self.mWebView.delegate = self; 

NSURL *url = [NSURL URLWithString:urlString]; 
NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url cachePolicy:NSURLCacheStorageAllowed timeoutInterval:15.0]; 
    [self.mWebView loadRequest:urlRequest]; 

以下 のコードはここにpInfo.list screenshot(私はいくつかのソリューションを見てきましたが、このサイトから私のために動作しません)

であると私はNSURLConnectionDataDelegateデリゲートで他のソリューションを適用している

- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace 
{ 
    return YES; 
} 

- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge { 
    NSArray *trustedHosts = [NSArray arrayWithObjects:@"mytrustedhost",nil]; 

    if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust]){ 
     if ([trustedHosts containsObject:challenge.protectionSpace.host]) { 
      [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge]; 
     } 
    } 
    [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge]; 
} 

Error Output screenshot

+0

を試してみてください? – Janmenjaya

答えて

0

は、あなたが文字列のURLを取っているコードの行を共有することができ、この1

NSString *[email protected]"accounts.craigslist.org"; 
NSString *str=[NSString stringWithFormat:@"%@",Url]; 
NSURL *urls=[[NSURL alloc]initWithString:str]; 

[_webView loadRequest:[NSURLRequest requestWithURL:urls]]; 
関連する問題