私はカスタムセルを持っており、それにセグメントコントロールを追加しています。
-(void)segmentclicked:(id)sender{
UISegmentedControl *segmentC = (UISegmentedControl *)sender;
CustomCell *cell=(CustomCell *)segmentC.superview.superview;
NSIndexPath *indexPath = [self.table indexPathForCell:cell];
NSMutableArray *discardarr = [NSMutableArray array];
[discardarr addObject:[self.entries objectAtIndex:indexPath.row]];
[self.table beginUpdates];
[self.itemsArray removeObjectsInArray:discardarr ];
[self.table deleteRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:NO];
self.entries = [NSArray arrayWithArray:self.itemsArray];
[self.table endUpdates];
[self.table reloadData];
}
}
私は次のエラーを受け取ります。
'NSInternalInconsistencyException'、理由: '無効な更新:セクション0の行数が無効です。更新(10)後に既存のセクションに含まれる行の数は、そのセクションに含まれる行の数と等しくなければなりませんupdate(10)、そのセクション(挿入された0、削除された1)から挿入または削除された行の数をプラスまたはマイナスし、そのセクションの内外に移動した行の数をプラスまたはマイナスします。 '
* First throw call stack:
1.)どのように私はこれを取り除くことができる、私はそれに応じてすべてをやったと信じています。私は [self.table endUpdates];
の上に [self.table reloadData];
という行を追加しようとしましたが、変更はありません。助けて