Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.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
Objective c 在Xcode中将url从数组加载到ImageView_Objective C_Arrays_Json_Xcode_Url - Fatal编程技术网

Objective c 在Xcode中将url从数组加载到ImageView

Objective c 在Xcode中将url从数组加载到ImageView,objective-c,arrays,json,xcode,url,Objective C,Arrays,Json,Xcode,Url,我需要将url从数组arrayCoverURL加载到ImageView NSURL *imageURL = [NSURL URLWithString:[arrayCoverURL objectAtIndex:indexPath.item]]; NSData *imageData = [[NSData alloc] initWithContentsOfURL:imageURL]; cell.imageView.image = [UIImage imageWithData:image

我需要将url从数组arrayCoverURL加载到ImageView

NSURL *imageURL = [NSURL URLWithString:[arrayCoverURL objectAtIndex:indexPath.item]];
    NSData *imageData = [[NSData alloc] initWithContentsOfURL:imageURL];
    cell.imageView.image = [UIImage imageWithData:imageData];

我需要在CollectionViewCell中将图像设置为ImageView。正在从字符串数组中的url地址加载图像。我该怎么做?张贴的代码有什么问题吗?嗯,是的。你的问题是什么?好的,我解决了我的问题。我试着用简单的代码编写,但最后我使用了SDWebImage。谢谢你!!!!它真的帮助了我!