如何在编辑时默认选择UITableViewCells

时间:2012-10-06 10:09:57

标签: iphone ios uitableview

enter image description here

在上面的屏幕截图中,我通过点击它们手动选择了单元格,但我希望默认情况下选择所有单元格进行编辑。

1 个答案:

答案 0 :(得分:3)

您可以使用此代码....

 for(int i=0; i<[array count]; i++)
 {
     NSIndexPath *indexP = [NSIndexPath indexPathForRow:i inSection:0];
    [tblView selectRowAtIndexPath:indexP animated:NO scrollPosition:UITableViewScrollPositionNone];
    [self tableView:tblView didSelectRowAtIndexPath:indexP];
 }

tblViewtableView

相关问题