0

使用 UIWebview 和基本身份验证(身份验证有效)但是我没有下载图像?谁能指出我正确的方向?

我正在连接这个:

connection = [[NSURLConnection alloc] initWithRequest:sourceUrl
                                             delegate:self 
                                     startImmediately:YES];

-(void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data{
 NSLog(@"%s", __FUNCTION__);
[webData appendData:data];
}



 -(void)connectionDidFinishLoading:(NSURLConnection *)connection{
    NSLog(@"%s", __FUNCTION__);
    [_webView loadData:webData 
              MIMEType: @"text/html" 
      textEncodingName: @"UTF-8" 
          baseURL:nil];

我的网页很好,但有几张图片没有加载。

4

1 回答 1

0

如果您使用相对路径,则应设置基本 URL。

于 2012-05-02T14:18:25.300 回答