I am populating a tableview at runtime. I have set an edit option for it where I can delete sections from it. Number of sections depends on an array and there is only one row in a section.
Problem:
When I click the Delete button I receive an exception in log which says:
Assertion failure in -[UITableView _endCellAnimationsWithContext:], /SourceCache/UIKit_Sim/UIKit-1448.89/UITableView.m:974
commitEditingStyle:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
Customer *objCustomer = [arrCustomerList objectAtIndex:indexPath.section];
NSString *strCusID = [objCustomer customerID];
CustomerModel *objCustomerModel = [[CustomerModel alloc]init];
[objCustomerModel deleteCustomer:strCusID];
[tableView beginUpdates];
[tableView deleteSections:[NSIndexSet indexSetWithIndex:indexPath.section] withRowAnimation:UITableViewRowAnimationLeft];
[tableView endUpdates];
[tableView reloadData];
}
}
numberOfSections...
– user756245