0
我在删除tableview中的单元格时出现问题,当我按下删除按钮时,程序会崩溃。删除表格中的单元格查看
这里是我的代码吧:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the managed object at the given index path
sect = [listArray objectAtIndex:indexPath.row];
[sect removeObjectAtIndex:indexPath.row];
// Update Event objects array and table view
[listArray removeObjectAtIndex:indexPath.row];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
tableView.editing = YES;
}
}
与什么碰撞? EXC_BAD_ACCESS或SIGABRT数组索引超出范围或什么? – 0x8badf00d
发布您的崩溃日志的输出。 – WrightsCS
thx,问题解决了 – John2