I simply try to delete a row from a UITableView with the following code:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
The problem is that my app crashes. (GDB: Program received signal: “EXC_BAD_INSTRUCTION”.)
Anybody know why?
You probably need to change the number returned in
for the
indexPath.sectionto be one lower than before the deletion.