【发布时间】:2012-03-09 16:39:54
【问题描述】:
当用户尝试从 UITableView 中删除一行时,我的应用程序崩溃,并且在调试器中我收到 SIGABRT 错误。
这是我的删除代码:
- (void) tableView:(UITableView *)tableView
commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete)
{
[[self displayedObjects] removeObjectAtIndex:[indexPath row]];
// Animate deletion
NSArray *indexPaths = [NSArray arrayWithObject:indexPath];
[[self tableView] deleteRowsAtIndexPaths:indexPaths
withRowAnimation:UITableViewRowAnimationFade];
//[[self tableView] deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]];
}
}
【问题讨论】:
-
尝试删除displayedObjects中对象之前的行。
-
我想我知道你的问题是什么。我会发布答案
-
谢谢 Raphael Ayres 我尝试了你的想法,但没有成功。
标签: ios uitableview crash sigabrt delete-row