tags:

views:

323

answers:

1

I am using this code...But its terminate my application some times

  • (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { //FeedArray is NSMutableArray if (editingStyle == UITableViewCellEditingStyleDelete) { [self.tableView beginUpdates]; [FeedArray removeObjectAtIndex:indexPath.row];

    [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
     withRowAnimation:UITableViewRowAnimationFade];
    

    } [self.tableView endUpdates]; }

Can anyone tell me the reason ? Or Is any other way doing this process?

Thanks in advance...

A: 

I think that [self.tableView endUpdates]; must be in if{} block

or [self.tableView beginUpdates]; must be before if{}

oxigen