我已经在这个东西上停留了很多小时,而且我不知道还要搜索什么。
由于调试器没有显示任何错误,但是可重现,因此我无能为力-我在表格视图中点击了一个非常具体的项目,该行为应该消除该模式,然后我的应用程序冻结。表格视图中的其他项目则不会发生这种情况-模态完全关闭,应用继续运行。
我检查了这个答案,怀疑这是一个死锁,但是:
layoutSubviews
方法之一上设置了断点,并且不断调用它。它不会调用[super layoutSubviews]
,也不会调用setNeedsLayout
任何人,并且只是设置其子视图的框架,因为我没有使用“自动布局”。我该如何调试这个东西?我一直在寻找Xcode Instruments,但无法理解所看到的数据。特别是,系统跟踪模板似乎可以在冻结发生时立即停止,这与其他继续记录的模板不同。
补充:我在系统跟踪中看到的内容
@ Paulw11的评论有所帮助-与系统跟踪工具相比,Time Profiler模板更适合此任务。
I used the Time Profiler and got led to a bunch of traces that point to the UINavigationBar as the suspect repetitive caller to my custom UIControl's layoutSubviews
. To further explain my view hierarchy:
Here's the deal: If I alloc-initWithFrame
my custom UIControl
with a frame of CGRectZero
, the app freezes. If I provide a garbage initial value to the frame (which is disregarded anyway since UINavigationBar reshapes my custom UIControl) like CGRectMake(0, 0, 10, 10)
, the crash doesn't happen.
我猜想UINavigationBar对如何布局初始帧为的自定义标题视图感到困惑(0, 0, 0, 0)
。听起来像是苹果的虫子。
注意:我在iOS 8.2上运行。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句