Y了个L
Y了个L
第一次滑动 vc1 的截图(左), 底部 tab 是正常的 第二次滑动 vc1 的截图(右), 底部 tab 是有问题的 
已经定位到问题了, 提交了PR https://github.com/QuintGao/GKNavigationBar/pull/113
第二个的崩溃信息 Fatal Exception: NSInternalInconsistencyException Attempted to scroll the collection view to an out-of-bounds item (11047) when there are only 11047 items in section 0. Collection view: .
Gemini 已分析了堆栈轨迹和其他指标,以下是分析结果: keyboard_arrow_up sparktip: 希望有更深入的数据分析? 提供更多信息以改进 Gemini 的分析 预览版 开始使用 The crash NSInternalInconsistencyException with the message "Attempted to scroll the collection view to an out-of-bounds item (11047) when there are...
原始代码: ``` - (void)prepareScrollCollectionViewToBottom { if (_shouldScrollToBottom && _models.count > 0) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self scrollCollectionViewToBottom]; // try fix #1562:https://github.com/banchichen/TZImagePickerController/issues/1562 if (@available(iOS 15.0, *)) { dispatch_after(dispatch_time(DISPATCH_TIME_NOW,...
我最后的方案是将 sortAscendingByModificationDate 设置为 NO了, 但是这个不是崩溃的根本原因, 你可以按照上面我说的那种方式修改一下, 或者自己分析原因, 最好开一下 AB实验
https://github.com/lieryang/AvoidCrash 我 fork 了一下, 增加了一些拦截, 欢迎大家可以一起共建! 如果需要提交代码, 请每个 PR 提交一个方法交换, 同时在 demo 中增加对应的测试方法!!! (PS: 可以先在 demo 中写测试方法, 如果发生了崩溃, 再进行对应的方法交换)
作者的 demo 你是一点也不用呀? demo 中有这个功能, 源代码都有, 自己复制粘贴使用就行了, 我就是这么干的