ユーザーがUITableViewから行を削除しようとしたときにアプリケーションがクラッシュし、デバッガでSIGABRTエラーが発生します。ここでテーブルビューの行を削除しようとすると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内で削除してみてください。 –
私はあなたの問題が何であるかを知っていると思います。私は答えを投稿します – JTApps
ありがとうRaphael Ayres私はあなたの考えを試みたが、うまくいかなかった。 – Ali