我在的UITableView工作,并试图让用户使用此代码UITableViewCell和UITableView重复选择其他单元格?
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSInteger row = [indexPath row];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if(cell != nil)
{
if(cell.accessoryType == UITableViewCellAccessoryNone)
{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else
{
cell.accessoryType = UITableViewCellAccessoryNone;
}
}
}
选择单元格,但问题是,当在一个页面中的细胞计数,如果你选择单元编号1的行号1每个页面也会被选中。
为什么第二个答案?你应该编辑你的第一个答案。 – EmptyStack 2011-06-03 08:29:47
谢谢!你能解释为什么这解决了这个问题吗? – 2012-08-20 13:34:59
你救了我的一天。谢谢。这解决了问题! – birdcage 2016-01-06 07:29:51