In `tableview` I have many sections, on the top row of section I have a delete button, I want to do delete section after clicking button but its crashing please help me how can I do this?? here is the code...

```
//****** adding delete section button
     CellButton *_sectionButton = (CellButton*)[cell viewWithTag:10];
     _sectionButton.hidden = YES;
     _sectionButton.indexPath = indexPath;
     [_sectionButton addTarget:self action:@selector(sectionDeleteButton:)      forControlEvents:UIControlEventTouchUpInside];

-(void)sectionDeleteButton: (id)sender
{
   CellButton *_secbtn = (CellButton*)sender;
   NSInteger sectionNumber = _secbtn.indexPath.section;
   [self.tableView beginUpdates];
   [self.tableView deleteSections:[NSIndexSet indexSetWithIndex:sectionNumber] withRowAnimation:UITableViewRowAnimationAutomatic];
    [self.tableView endUpdates];
    [self.tableView reloadData];

}

```

EDIT: The error messsage is:

> 
> Assertion failure in -[UITableView \_endCellAnimationsWithContext:], /SourceCache/UIKit\_Sim/UIKit-2380.17/UITableView.m:1054 2013-07-04 04:25:15.921 estimation[9025:c07] \*\*\* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of sections. The number of sections contained in the table view after the update (2) must be equal to the number of sections contained in the table view before the update (2), plus or minus the number of sections inserted or deleted (0 inserted, 1 deleted)
> 
> 
>