Geoff H
Geoff H

Reputation: 3247

UICollectionView Assertion failure in -[UICollectionView _updateWithItems:tentativelyForReordering:]

iOS8.4. On device not simulator.

I'm getting this carsh error;

Assertion failure in -[UICollectionView _updateWithItems:tentativelyForReordering:], /SourceCache/UIKit/UIKit-3347.44.2/UICollectionView.m:4563

When I call

NSArray* array_indexPaths = [NSArray arrayWithObject:[NSIndexPath indexPathForRow:1 inSection:0]];
[self.collectionView reloadItemsAtIndexPaths:indexPaths];

have tried putting the above inside [self.collectionView performBatchUpdates:^{ with no luck.

Is there anyone else who has experienced this or knows why it's happening?

Upvotes: 16

Views: 8048

Answers (1)

heyfrank
heyfrank

Reputation: 5647

I found this rdar: http://www.openradar.me/26280932 which says:

Calling insertItemsAtIndexPaths: on UICollectionView after viewDidLoad but before viewDidAppear: will cause an assertion failure in -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:]. Calling reloadData in the same scenario doesn't generate the assertion.

So you could check if you are doing your call before viewDidAppear and adjust/wait before view did appear.

Upvotes: 8

Related Questions