UITableView的cell表格刷新(增长,删除,修改)

UITableView删除

1.删除步骤(add,update are the same)

  • 删除对应行模型数据
  • 让tableView从新加载数据源

2.具体代码(按标题1的步骤来写代码)

  • 删除对应行模型数据git

     

-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ [self.tuangous removeObjectAtIndex:indexPath.row]; [tableView reloadData]; }github

* 让tableView从新加载数据源

```objc
-(void) tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{
 [self.tuangous removeObjectAtIndex:indexPath.row];
 [tableView reloadData];
}

3.代码地址

相关文章
相关标签/搜索