我想取消选择先前选择的行再次选择。我只能取消选中该行点击其他行,但我想再次取消选择此点击。我怎样才能做到这一点?如何取消选择在目标c中选择的行?
这是我的代码:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self updateTableView];
}
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self updateTableView];
}
- (void)updateTableView
{
[self.tableView beginUpdates];
[self.tableView endUpdates];
}
谢谢!
请在发布问题之前检查是否存在相关的问题。 http://stackoverflow.com/questions/3968037/how-to-deselect-a-selected-uitableview-cell –