- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath { return @"删除"; } - (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { return UITableViewCellEditingStyleDelete; } - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { debugMethod(); NSLog(@"%ld,%ld", indexPath.section, indexPath.row); if (editingStyle == UITableViewCellEditingStyleDelete) { //移除数据源的数据 NSMutableArray *mutableArr = [self.goodsListArray mutableCopy]; [mutableArr removeObjectAtIndex:indexPath.row]; self.goodsListArray = [mutableArr copy]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationLeft];//移除tableView中的数据 } }