为具有 Reactive Cocoa 的单元格设置图像

Set Image for cell with Reactive Cocoa

我正在尝试用来自视图模型的信号填充我的单元格值 class:

-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    cell = [tableView dequeueReusableCellWithIdentifier:@"Cell" forIndexPath:indexPath];

    if ([self.viewModel.dataArray count] >4){

    // Text
    cell.titleLabel.text = [[self.viewModel.dataArray objectAtIndex:indexPath.row]valueForKey:@"title"];

        NSString *urlString = [[self.viewModel.dataArray objectAtIndex:indexPath.row] valueForKey:@"thumbnailImage"];

        NSLog(@"Called n times");
    // Image
    [[[self.viewModel loadImageWithString:urlString]
                    deliverOn:[RACScheduler mainThreadScheduler]]
                    subscribeNext:^(UIImage* x) {

                        cell.myImageView.image = x;
                    }];

    }


    return cell;

}

每个单元格的标题都很好,显示正确。但是图像只为最后一个单元格设置,它闪烁 5 次(图像数量来自 jSON)非常快,最后一个图像完成。

我错过了什么拼图?

使用 'cell.myImageView.image=x;' 会产生问题,寻找在索引路径中设置图像的其他选项(再次从中获取 UITableViewCell)