当我的窗口加载时,我得到了一个崩溃(回溯如下)。它似乎暗示着Core Animation正在发生一些事情,但我并没有启动任何动画,只是显示窗口。
将特定堆栈视图的剪切阻力从1000更改为750,在一段时间内避免了崩溃,但现在它又回来了,尽管它发生在不同的时间点。
我试图创建我的布局的一个简化版本来演示这个问题,但是我无法重现这个问题。所以我能做的就是向你推荐完整的应用程序:https://github.com/Uncommon/Xit/tree/0b70352239b6fbaba6d26c952ce6de4f111a5346
Crash回溯:
#0 0x00007fff4339c454 in -[NSApplication _crashOnException:] ()
#1 0x00007fff43968cb1 in __65+[CATransaction(NSCATransaction) NS_setFlushesWithDisplayRefresh]_block_invoke ()
#2 0x00007fff45af4417 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ ()
#3 0x00007fff45af433f in __CFRunLoopDoObservers ()
#4 0x00007fff45ad68b8 in __CFRunLoopRun ()
#5 0x00007fff45ad6153 in CFRunLoopRunSpecific ()
#6 0x00007fff44dc0d96 in RunCurrentEventLoopInMode ()
#7 0x00007fff44dc0a0f in ReceiveNextEventCommon ()
#8 0x00007fff44dc0884 in _BlockUntilNextEventMatchingListInModeWithFilter ()
#9 0x00007fff43071a73 in _DPSNextEvent ()
#10 0x00007fff43807e34 in -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] ()
#11 0x00007fff43066885 in -[NSApplication run] ()
#12 0x00007fff43035a72 in NSApplicationMain ()
#13 0x0000000100005794 in main at /Users/i58922/Developer/Personal/Xit/Xit/main.m:5
#14 0x00007fff6d91d015 in start ()
#15 0x00007fff6d91d015 in start ()这种情况下可能的罪魁祸首是什么?我怎么才能缩小范围?这是一个有点复杂的窗口,包含嵌套的拆分视图等等。
发布于 2018-08-10 23:56:59
最后,我将范围缩小到调用tableView.view(atColumn:,row:,makeIfNecessary:)时使用的行索引越界。这导致了一个异常,然后在崩溃之前展开堆栈到一个无法识别的点。
如果我打开了我的“所有Objective-C异常”断点,我会更快地找到它,这应该是最明显的事情,因为它在[NSApplication _crashOnException:]中崩溃了。
https://stackoverflow.com/questions/51771743
复制相似问题