2012-10-06 35 views
0

enter image description here如何让UITableViewCells默认情况下,编辑

选择在上面的截图中我已经手动选择的细胞通过点击他们,但我要为默认的编辑被选中所有单元格。

+0

cell.accessoryType = UITableViewCellAccessoryCheckmark; 使用它或给你的代码:) :) – 2012-10-06 10:14:44

+0

试试这个cell.selected = YES;在cellForRowAtIndex:方法中 –

回答

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]; 
} 

哪里tblView是你tableView

相关问题