ios - UIScrollView 崩溃

标签 ios objective-c uiscrollview

<分区>

有没有人见过这个与 ScrollView 相关的崩溃?我无法重现这一点,但我已经通过我们的分析工具结构在实时构建中收到了这一点。

Thread : Crashed: com.apple.main-thread
0  libobjc.A.dylib                0x0000000192e9bbd0 objc_msgSend + 16
1  UIKit                          0x000000018670f608 -[UIScrollView _getDelegateZoomView] + 80
2  UIKit                          0x000000018699531c -[UIScrollView _offsetForCenterOfPossibleZoomView:withIncomingBoundsSize:] + 64
3  UIKit                          0x0000000186d81f34 -[UIView(AdditionalLayoutSupport) _nsis_center:bounds:inEngine:] + 1208
4  UIKit                          0x00000001867bc9d8 -[UIView(Geometry) _applyISEngineLayoutValues] + 160
5  UIKit                          0x00000001866d6554 -[UIView(Geometry) _resizeWithOldSuperviewSize:] + 276
6  UIKit                          0x00000001866d1b18 -[UIView(Hierarchy) layoutBelowIfNeeded] + 712
7  MyAppDetailCell                0x00000001000f29e0 -[MyAppDetailCell displayDataDelayed:] (MyAppDetailCell.m:139)
8  Foundation                     0x0000000182d9cba4 __NSFireDelayedPerform + 424
9  CoreFoundation                 0x0000000181e6ac20 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 28
10 CoreFoundation                 0x0000000181e6a8d0 __CFRunLoopDoTimer + 888
11 CoreFoundation                 0x0000000181e6831c __CFRunLoopRun + 1372
12 CoreFoundation                 0x0000000181d951f4 CFRunLoopRunSpecific + 396
13 GraphicsServices               0x000000018b1b76fc GSEventRunModal + 168
14 UIKit                          0x000000018672610c UIApplicationMain + 1488
15 MyApp                          0x00000001000f66f4 main (main.m:16)
16 libdyld.dylib                  0x0000000193506a08 start + 4

由于公司政策,我不能在这里上传代码。我正在做一些动画(SpriteKit),修改一些约束,主要是在该 displayDataDelayed 方法中进行 UI 更新,但不接触此方法中的 ScrollView 。我预计在一些约束更新之后 layoutIfNeeded 可能会导致这种情况。但又无法重现这一点。自上次更新以来,我们在 4 天内有 1200 万次应用 session ,这发生了 1000 次,因此绝对不容易重现。

最佳答案

尝试以下操作。它对我有用

self.scrollView.delegate = nil;
self.scrollView = nil;

我使用 ARC 没有多大意义,但它对我有用。

还要检查 scrollview 的父 View 的 View Controller 是否是弱引用。这可能也是一个问题。祝你好运。

关于ios - UIScrollView 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29642339/

相关文章:

ios - 弹出回 View Controller 时 UIButton 文本不更新

ios 5 : Calling a block in iPhone twice for different values

ios - 无法删除 Xcode 5 中的目标

ios - TweetSheet 和 FacebookSheet 初始文本

objective-c - 为什么我们不能在 NSFetchedResultsController 中改变 FetchRequest?

ios - ScrollView 滚动时页面控制不改变

uiviewcontroller - 为什么 NavigationLink 按钮在自定义 UIViewControllerRepresentable 包装器中显示为 "disabled"

ios - 表的未解析标识符 (Swift 2)

ios - 如何在 Swift 中更改 UIScrollView 的背景颜色?

objective-c - 为什么在if语句中设置Block变量会导致崩溃?