Iphone 滚动表格视图后显示的图像(AFN)

Iphone 滚动表格视图后显示的图像(AFN),iphone,ios,objective-c,networking,afnetworking,Iphone,Ios,Objective C,Networking,Afnetworking,我使用AFNetworking从服务器下载图像,一切正常,但图像不会出现,除非我滚动表格视图。这是我的密码: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell*cell = [tabl

我使用AFNetworking从服务器下载图像,一切正常,但图像不会出现,除非我滚动表格视图。这是我的密码:

   - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
        static NSString *CellIdentifier = @"Cell";
        UITableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];

}

//configuring news feed
    dictionary = [newsFeed objectAtIndex:indexPath.row];
 //display thumbnails


    UIImageView *image = [[UIImageView alloc]init];
    [image setImageWithURL:[NSURL URLWithString:[dictionary objectForKey:@"image"]]placeholderImage:[UIImage imageNamed:NEWSAVATAR]];
    cell.imageView.image = [image.image imageScaledToSize:CGSizeMake(55, 55)];
    [cell setNeedsLayout];


    return cell;
}
试试这个

[ cell.imageView.image  setImageWithURL:[NSURL URLWithString:[dictionary objectForKey:@"image"]]placeholderImage:[UIImage imageNamed:NEWSAVATAR]];

此委托方法仅在该单元格可见时调用,即您已滚动到该单元格。如果您不想发生这种情况,您必须调用web服务并将所有图像保存在本地,然后从本地文件夹中选取。

可能的重复可能是因为您的单元格正在被删除,您能否将整个
单元格的行为索引路径:
代码,或至少初始化单元格part@Bonnie我编辑了我的帖子