Assertion Failure in UICollectionViewData indexPathForItemAtGlobalIndex

后端 未结 8 2078
南旧
南旧 2020-12-15 04:15

I am using performBatchUpdates() to update my collection view, where I am doing a complete refresh, i.e. delete whatever was in it and re-insert everything.

8条回答
  •  没有蜡笔的小新
    2020-12-15 04:53

    I still couldn't figure out how the global index was incremented so much, but I solved my problem by inserting a temporary item in the underlying datasource array i.e. cellItems and calling [self.collectionview reloadData] in viewDidLoad().

    This inserts a placeholder cell temporarily in the collection view until I trigger the actual process using performBatchUpdates().

提交回复
热议问题