Ios 将下载的图像加载到阵列并在uitableview中显示

Ios 将下载的图像加载到阵列并在uitableview中显示,ios,image,uitableview,Ios,Image,Uitableview,在我的uitableview中,我试图添加和显示从解析查询下载的图像,但似乎没有任何符号起作用。以下是我将图像添加到阵列的方式: PFFile *image = (PFFile *)[wallObject objectForKey:@"image"]; UIImage *img = [UIImage imageWithData:image.getData]; [allImages addObject:img atIndex:0]; 这就是我试图在uitableview单元格中显示索引路径

在我的uitableview中,我试图添加和显示从解析查询下载的图像,但似乎没有任何符号起作用。以下是我将图像添加到阵列的方式:

 PFFile *image = (PFFile *)[wallObject objectForKey:@"image"];
 UIImage *img = [UIImage imageWithData:image.getData];
 [allImages addObject:img atIndex:0];
这就是我试图在uitableview单元格中显示索引路径方法处的行的方式:

   NSData *picData = [allImages objectAtIndex:indexPath.row];
    [(UIImageView *)[cell.contentView viewWithTag:2] setImage:[UIImage imageWithData:picData]];
我不知道为什么它不工作,任何帮助将不胜感激!
请友善点,我还是新来的

allImages
数组中添加
UIImage*
对象,然后在配置单元格之前从中获取
NSData*
对象。请尝试以下操作:

UIImage *image = [allImages objectAtIndex:indexPath.row];
[(UIImageView *)[cell.contentView viewWithTag:2] setImage:image];

伟大的此外,您还可以为
UIImageView
子视图添加属性,并简单地设置如下图像
cell.myImageView.image=allImages[indexPath.row]
。请记住,
UITableViewCell
有一个内置的
UIImageView
属性。