ios - UICollectionView 重新加载某些部分崩溃

标签 ios objective-c

当请求数据成功时,我重新加载部分。方法是:

[self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:1]];

  NSIndexPath *idx = [NSIndexPath indexPathForItem:0 inSection:1];
  [self.collectionView reloadItemsAtIndexPaths:@[idx]];

这是控制台输出:

[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UICollectionView.m:4324

这个问题是偶尔出现的!

提前致谢!

最佳答案

我遇到了同样的问题。当其他部分的项目计数发生更改,但您仅重新加载已更改的部分之一时,就会发生这种情况。

关于ios - UICollectionView 重新加载某些部分崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35790658/

相关文章:

ios - 在自定义 UITableViewCell 中消除 UITextField 的问题

ios - 使用导航栏时 IQKeyboardManager 问题

ios - If 语句不适用于 TableView 单元格

ios - 没有 NSURLConnection 委托(delegate)的 POST 请求

objective-c - block 可以通过 Objective C 中的协议(protocol)替换委托(delegate)模式吗?

ios - Swift 不会打印来自通知委托(delegate)的有效负载

ios - 无法转换 CCScene

objective-c - 尝试从 Mac 上的 HID 管理器获取 HID 设备引用时出现不兼容指针错误

ios - Xcode 中的文件不工作(名称为红色)

objective-c - iOS:UIImagePickerController 和 ResignFirstResponder