gpt4 book ai didi

ios - PerformBatchUpdates 中的 reloadData :completion: does not call cellForItemAtIndexPath:

转载 作者:行者123 更新时间:2023-12-02 01:19:38 25 4
gpt4 key购买 nike

所以当我注意到这段代码时,我正在玩我的UITableView:

[self performBatchUpdates:^{
[self reloadData];
} completion:^(BOOL finished) {}];

不会导致调用cellForItemAtIndexPath:,仅调用UICollectionViewFlowLayoutsizeForItemAtIndexPath

有人知道为什么会发生这种情况吗?

我确切地知道 reloadData 中发生了什么,但这与此不同。

最佳答案

来自 reloadData 的文档:“不应在插入或删除行的方法中调用它,尤其是在通过调用 beginUpdates 和 endUpdates 实现的动画 block 中。”也许这也适用于performBatchUpdates

关于ios - PerformBatchUpdates 中的 reloadData :completion: does not call cellForItemAtIndexPath:,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25134727/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com