特定のセルのみが画像を取得するように、if ステートメントを使用しています。私のテスト例では、画像を取得する必要があるセルは 1 つだけで、if ステートメントは 1 回だけ実行されます。if ステートメントは、ラベルのテキストも変更します。ラベルは正しく変更されていますが、特に上下にスクロールすると、画像が複数のセルに追加されます。他のセルに余分な画像を追加しないようにする方法。
UIImageView *imageView= [[UIImageView alloc]initWithFrame:CGRectMake(114,5, 122, 63)];
if (condition) {
[imageView setImageWithURL:url placeholderImage:[UIImage imageNamed:@"Placeholder.png"]];
imageView.tag = 777;
[cell addSubview:imageView];
cell.titleLabel.text = [dict valueForKey:@"name"];
cell.titleDescription.text = [dict valueForKey:@"summary"];
} else {
[[cell viewWithTag:777] removeFromSuperview];
}