Uitableview 如何在数组中添加多个cell.textLabel.text?
我在UITableViewController中使用进行了如下多项选择。这是UIAlertView的委托方法,其中有UIAlertView包含表 现在,我如何将特定的选定indexPath.row添加到数组中,并在有人取消选中它时将其删除Uitableview 如何在数组中添加多个cell.textLabel.text?,uitableview,didselectrowatindexpath,Uitableview,Didselectrowatindexpath,我在UITableViewController中使用进行了如下多项选择。这是UIAlertView的委托方法,其中有UIAlertView包含表 现在,我如何将特定的选定indexPath.row添加到数组中,并在有人取消选中它时将其删除 - (void)tableAlert:(SBTableAlert *)tableAlert didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"MY INDEX PATH IS %@", in
- (void)tableAlert:(SBTableAlert *)tableAlert didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"MY INDEX PATH IS %@", indexPath);
if (tableAlert.type == SBTableAlertTypeMultipleSelct) {
UITableViewCell *cell = [tableAlert.tableView cellForRowAtIndexPath:indexPath];
if (cell.accessoryType == UITableViewCellAccessoryNone)
[cell setAccessoryType:UITableViewCellAccessoryCheckmark];
else
[cell setAccessoryType:UITableViewCellAccessoryNone];
[tableAlert.tableView deselectRowAtIndexPath:indexPath animated:YES];
}
}
我很想为tableView创建一个项目字典。然后为字典中的每个对象设置一个“selected”bool属性。然后,您可以简单地将其设置为true或false,并使用
[tableView reloadRowsAtIndexPaths:@[indexPath]with RowAnimation:UITableViewRowAnimationNone]代码>点击警报视图时。如果需要知道选择了哪些对象的行,还可以枚举到