I m getting this error on performing insertItemsAtIndexPaths in UICollectionView
Assertion failure in:
-[UICollectionViewD
In my case, the problem was the way I was creating my NSIndexPath. For example, to delete the 3rd cell, instead of doing :
NSIndexPath* indexPath = [NSIndexPath indexPathWithIndex:2];
[_collectionView deleteItemsAtIndexPaths:@[indexPath]];
I needed to do :
NSIndexPath* indexPath = [NSIndexPath indexPathForItem:2 inSection:0];
[_collectionView deleteItemsAtIndexPaths:@[indexPath]];