UITableView删除
1.删除步骤(add,update are the same)
- 删除对应行模型数据
- 让tableView重新加载数据源
2.具体代码(按标题1的步骤来写代码)
-
删除对应行模型数据
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ [self.tuangous removeObjectAtIndex:indexPath.row]; [tableView reloadData]; }
* 让tableView重新加载数据源
```objc
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
[self.tuangous removeObjectAtIndex:indexPath.row];
[tableView reloadData];
}