gpt4 book ai didi

macos - [NSApplication _crashOnExeption] 崩溃

转载 作者:行者123 更新时间:2023-12-03 16:14:23 27 4
gpt4 key购买 nike

当我的窗口加载时,我遇到了崩溃(下面的回溯)。这似乎表明核心动画正在发生一些事情,但我没有启动任何动画,只是显示窗口。

将特定堆栈 View 的剪切阻力从 1000 更改为 750 可以暂时避免崩溃,但现在它又回来了,尽管现在发生在不同的时间点。

我尝试创建布局的简化版本来演示此处的问题,但无法重现该问题。所以我所能做的就是向您推荐完整的应用程序:https://github.com/Uncommon/Xit/tree/0b70352239b6fbaba6d26c952ce6de4f111a5346

崩溃回溯:

#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 ()

这种情况下可能的罪魁祸首是什么?我怎样才能缩小范围?这是一个有点复杂的窗口,带有嵌套的分割 View 等。

最佳答案

我最终将范围缩小到我调用 tableView.view(atColumn:,row:,makeIfNecessary:) 时行索引超出范围的事实。这导致了一个异常,然后在崩溃之前将堆栈展开到一个无法识别的点。

如果我打开“所有 Objective-C 异常”断点,我会发现它更快,这应该是显而易见的事情,因为它在 [NSApplication _crashOnException:] 中崩溃.

关于macos - [NSApplication _crashOnExeption] 崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51771743/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com