0

I have UICollectionView. I want to delete a item with animation. So I have used the below code.

 [UIView animateWithDuration:0.15f animations:^{
    [self.collectionView deleteItemsAtIndexPaths:@[indexPath]];
    }];

Sometimes it crashes and saying that

Fatal Exception: NSInternalInconsistencyException Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (5) must be equal to the number of items contained in that section before the update (5), plus or minus the number of items inserted or deleted from that section (0 inserted, 1 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).

Can somebody help me out on this. Thanks in advance.

Sheik_101
  • 770
  • 1
  • 8
  • 24

0 Answers0