Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/lua/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 从“HTTPS”类型的url加载图像并显示在UIImageview中_Ios_Objective C_Https_Uiimageview_Xcode6 - Fatal编程技术网

Ios 从“HTTPS”类型的url加载图像并显示在UIImageview中

Ios 从“HTTPS”类型的url加载图像并显示在UIImageview中,ios,objective-c,https,uiimageview,xcode6,Ios,Objective C,Https,Uiimageview,Xcode6,我正在开发一个iOS应用程序,在该应用程序中,我从服务器接收图像的HTTPS URL。我现在无法从这些URL加载图像。我尝试过几种框架,如AFNetworking、SDImageView等,但它们都无法从这些类型的URL加载图像 更新: 代码示例 [cell.imgVwPhoto setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[arrayImages objectAtIndex:indexPath

我正在开发一个iOS应用程序,在该应用程序中,我从服务器接收图像的HTTPS URL。我现在无法从这些URL加载图像。我尝试过几种框架,如AFNetworking、SDImageView等,但它们都无法从这些类型的URL加载图像

更新:

代码示例

[cell.imgVwPhoto setImageWithURLRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[arrayImages objectAtIndex:indexPath.row]]] placeholderImage:[UIImage imageNamed:@"placeholder-avatar"]
    success:^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) {
        [UIView transitionWithView:cell.imgVwPhoto
        duration:0.2
        options:UIViewAnimationOptionTransitionCrossDissolve
        animations:^{
            cell.imgVwPhoto.image = image;
        }
        completion:NULL];
    }
    failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error){
        NSLog(@"Error");
    }];
这里的URL是HTTPS类型。 所以,这是行不通的

任何帮助都将不胜感激。

试试这个

NSURL *url=[NSURL URLWithString:@"yourURL"];
NSData *data=[NSData dataWithContentsOfURL:url];
UIImage *aImage=[UIImage imageWithData:data];
这会奏效的

NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString: @"http://myurl/mypic.jpg"]];
UIImageView *imView = [[UIImageView alloc] initWithImage:[UIImage imageWithData: imageData]];

希望能有所帮助。

通过在我创建的webservice调用框架中修改一些参数,问题得以解决。 所有这些更改都是根据我调用的服务器进行的


谢谢

显示一些代码,如何加载这些图像?您是否尝试从其他https资源加载?加载这些图像(如果有)时会发生什么错误?请检查编辑。请共享完整的图像url对不起,我无法共享。您确定此url上有图像吗?没有html作为热链接保护的结果?它不工作,我已经尝试过这个。代码显示错误:NSURLConnection/CFURLConnection HTTP加载失败kCFStreamErrorDomainSSL,-9813我可以查看你的代码和url吗?我已经尝试过你的代码和url是任何通用url,但不是HTTPS类型。检查你的url你没有得到数据来响应你的url。我可以从该url在浏览器中打开图像,但不能在iOS代码中打开。所以,URL没有问题。你能分享一下你所做的改变吗?