【发布时间】:2010-02-09 14:11:23
【问题描述】:
我只是尝试使用以下代码从UITableView 中删除一行:
- (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”。) 有人知道为什么吗?
【问题讨论】:
-
你在 objc_exception_throw 上有符号断点吗?如果没有,请尝试添加它并查看执行停止的位置。
-
另外,如果您在代码前面放置 4 个空格,则格式会更好,更易于阅读。
-
好的,感谢您格式化我的代码。执行在这里停止:+[NSException raise:format:arguments:] ...有什么想法吗?
-
控制台有错误说明吗?
标签: iphone uitableview crash row