commitEditingStyleを使用してUitableviewから行を削除すると、このエラーでアプリケーションがクラッシュします。 、 ' 理由:' によりキャッチされない例外NSInternalInconsistencyExceptionに /SourceCache/UIKit_Sim/UIKit-1912.3/UITableView.m:1046 .Terminatingアプリ無効更新:無効:[のUITableView _endCellAnimationsWithContext] - でUItableviewから行を削除するとクラッシュする
アサーション障害(2) の後の既存のセクションに含まれる行の数は、 の更新(1)より前に、そのセクションに含まれる行の数と同じでなければなりません。その部分(挿入された0、削除された1)から が挿入または削除され、プラスまたはマイナス番号の がoその部分からr(0は移動、0は移動)。
これは私のコードです:
- (void)tableView:(UITableView *)tv commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
// If row is deleted, remove it from the list.
if (editingStyle == UITableViewCellEditingStyleDelete) {
order *OrderObj= [appDelegate.orderArray objectAtIndex:[indexPath row]];
[appDelegate removeitem:OrderObj];
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
} }
replying..Yourの答えのための – Deepesh