mardi 4 août 2015

UICollectionView crashing on insertSections, with endItemAnimationsWithInvalidationContext:tentativelyForReordering:

I'm trying to add a new section to my collection view, as a new section's worth of data is added to the data source. I'm doing it like this:

self.conversationCollectionView.performBatchUpdates({
    self.conversationCollectionView.insertSections(NSIndexSet(index: 0))
}, completion: {
(finished: Bool) -> Void in
})

I started by not using performBatchUpdates, too. Either way, I get this crash, every time:

Assertion failure in -[MyApp _endItemAnimationsWithInvalidationContext:tentativelyForReordering:]

This is after running the line insertSections.

I have more than 0 indexes. I've tried changing that index number to other values, including the correct value. I get the same crash, every time. It doesn't seem to be an 'out of bounds' kind of error. I'm not sure what it is.

Aucun commentaire:

Enregistrer un commentaire