因为单元格正在被重用,所以如果需要设置或取消设置,那么如果它重用单元格并且勾号在那里,那么它将再次显示。请注意,如果你有20行,但屏幕上只有4行,iOS将只绘制其中的几行,并且当其中一行被重复用于下一行时。
大部分didSelect。。。。不需要。
对此进行更改;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"filterCuisineCell";
CuisineTableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (indexPath.row == selectedRow.row) { // if you have sections then compare the whole indexPath
cell.imageView.image = [UIImage imageNamed:@"TickedCircle"];
}
else
{
cell.imageView.image = [UIImage imageNamed:@"UntickedCircle"];
}
cell.textLabel.text = [cuisinesArray objectAtIndex:indexPath.row];
return cell;
}