Assertion Failure in UICollectionViewData indexPathForItemAtGlobalIndex

后端 未结 8 2052
南旧
南旧 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:49

    reloadData doesn't work for me, because the whole purpose of using performBatchUpdates is to get the changes animated. If you use reloadData you only refresh the data, but without animations.

    So suggestions of "replace performBatchUpdates with reloadData" is pretty much saying "give up on what you're trying to do."

    I'm sorry, I'm just frustrated because this error keeps coming up for me while I'm trying to do some great animated updates and my model is 100 % correct, it's some iOS magic inside getting broken and forcing me to change my solutions completely.

    My opinion is that Collection Views are still buggy and can't do complicated animated refreshes, even though they should be able to. Because this used to be the same thing for Table Views but those are now pretty stable (it took time, though).

    //Edit (Sep 1, 2013) The reported bug is closed now so this issues seems to have been resolved by Apple already.

提交回复
热议问题