Objective c 在Xcode中将url从数组加载到ImageView
我需要将url从数组arrayCoverURL加载到ImageViewObjective 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
NSURL *imageURL = [NSURL URLWithString:[arrayCoverURL objectAtIndex:indexPath.item]];
NSData *imageData = [[NSData alloc] initWithContentsOfURL:imageURL];
cell.imageView.image = [UIImage imageWithData:imageData];
我需要在CollectionViewCell中将图像设置为ImageView。正在从字符串数组中的url地址加载图像。我该怎么做?张贴的代码有什么问题吗?嗯,是的。你的问题是什么?好的,我解决了我的问题。我试着用简单的代码编写,但最后我使用了SDWebImage。谢谢你!!!!它真的帮助了我!