我只是尝试UITableView
使用以下代码从 a 中删除一行:
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
[self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
问题是我的应用程序崩溃了。(GDB:程序接收信号:“EXC_BAD_INSTRUCTION”。)有人知道为什么吗?