Iphone 如何默认选择UITableViewCells进行编辑
Iphone 如何默认选择UITableViewCells进行编辑,iphone,ios,uitableview,Iphone,Ios,Uitableview,在上面的屏幕截图中,我已通过单击手动选择了单元格,但我希望默认情况下选择所有单元格进行编辑。您可以使用此代码 for(int i=0; i<[array count]; i++) { NSIndexPath *indexP = [NSIndexPath indexPathForRow:i inSection:0]; [tblView selectRowAtIndexPath:indexP animated:NO scrollPosition:UITableViewSc
在上面的屏幕截图中,我已通过单击手动选择了单元格,但我希望默认情况下选择所有单元格进行编辑。您可以使用此代码
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];
}
for(inti=0;i您可以使用此代码
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];
}
对于(int i=0;icell.accessoryType=UITableViewCellAccessoryCheckmark;使用它或提供您的代码…:)请尝试此单元格。selected=YES;in-CellForRowatinex:Methodcell.accessoryType=UITableViewCellAccessoryCheckmark;使用它或提供您的代码…:)尝试此单元格。selected=YES;in-CellForRowatinex:方法