HII每一個問題刪除分組表
我用下面的代碼rgouped表視圖
- (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
if(editingStyle == UITableViewCellEditingStyleDelete) {
//Get the object to delete from the array.
insertUpdateDelete *objInsertUpdateDelete = [appDelegate.arrObjects objectAtIndex:indexPath.row];
[appDelegate DeleteRecord:objInsertUpdateDelete];
//Delete the object from the table.
[tableView1 deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
}
}
刪除行,但其在該行
[tableView1 deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
崩潰的行
崩潰日誌是:
2011-0 5-20 19:21:20.233 IICS [10744:207] *斷言故障 在 - [UITableView的 _endCellAnimationsWithContext:],/SourceCache/UIKit_Sim/UIKit-1448.89/UITableView.m:995 2011-05-20 19:21:20.235 IICS [10744:207]
*** Terminating app due to uncaught exception
'NSInternalInconsistencyException', 原因:無效更新:在第0。 數包含在後 現有段的行的無效 數量的行更新(3) 必須等於行數 co在 更新(3)前加上或減去插入或刪除 節(插入0個,刪除1個)的行的編號爲 。
任何哥們都可以幫我嗎? thanx
實際上我不需要刪除每一節中的所有第一行,因爲我加載到該節的每一行的數據來自sqlite數據庫表的單行 – Ravi 2011-05-20 14:15:22
我不認爲所以。他從3行開始,刪除後仍有3行。這在第0節發生,但這是無關緊要的。 – Rayfleck 2011-05-20 14:19:45