Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionView Assertion failure in deleteItemsAtIndexPaths

Here is my error:

*** Assertion failure in -[PSUICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-2372/UICollectionView.m:2801

I'm calling it like this:

[self.collectionView deleteItemsAtIndexPaths:@[[NSIndexPath indexPathForItem:1 inSection:1]]];

Why is this happening, any ideas?

like image 830
Devfly Avatar asked Dec 04 '12 16:12

Devfly


1 Answers

Do you remove the item from your model as well? So, for example, if the number of rows, sections and the content they present is taken from a dictionary of arrays whose keys represent the sections and each array the rows, then if you delete one row with deleteItemsAtIndexPaths you're responsible to update the dictionary accordingly. UICollectionView will not do it for you.

like image 109
Rad'Val Avatar answered Sep 19 '22 02:09

Rad'Val