如何在tableView中取消选择以前选择的行?我找不到获取oldIndexPath
的解决方案-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
if (newCell.accessoryType == UITableViewCellAccessoryNone) {
newCell.accessoryType = UITableViewCellAccessoryCheckmark;
}
}
答案 0 :(得分:2)
除非您存储以前的索引路径,否则您将无法检索它 只需将其存储在ivar中,当您检测到某行时,下次您将能够删除上一个单元格上的复选标记。