首先
[userTable setEditing:!userTable.editing animated:YES];
这个方法能够马上进入uitableview的编辑模式
-(UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath //这个方法是判断编辑模式是增加还是删除(返回值)
{
// return UITableViewCellEditingStyleDelete;//删除编辑
return UITableViewCellEditingStyleInsert ;//增加
}
下面方法是增加和 删除所要的操作都在下面函数中定义
-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
//修改删除按钮的文字
-(NSString*)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
记住使用uitablevie的时候 要遵循 的两个代理<UITableViewDataSource,UITableViewDelegate>