在macOS Cocoa App中诊断KVO崩溃的步骤

时间:2019-04-12 11:52:38

标签: xcode macos cocoa key-value-observing

我得到:

  

'KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED',

关闭基于文档的Cocoa ObjC应用程序的主窗口时的

通知。我在该区域的项目中没有任何KVO观察员,因此没有可移除的观察员。使用NSZombie无法诊断。我怀疑可能是重复使用的内存地址。谁能推荐我如何确定此问题涉及的对象?理想情况下,我希望看到观察者对象,以便可以从那里向后工作。

* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x3eadde6d1760)
    frame #0: 0x00007fff68cf38ee libobjc.A.dylib`object_isClass + 31
  * frame #1: 0x00007fff3f0840f6 Foundation`KVO_IS_RETAINING_ALL_OBSERVERS_OF_THIS_OBJECT_IF_IT_CRASHES_AN_OBSERVER_WAS_OVERRELEASED_OR_SMASHED + 58
    frame #2: 0x00007fff3f2145fe Foundation`NSKeyValueWillChangeWithPerThreadPendingNotifications.llvm.15835543126851482145 + 282
    frame #3: 0x00007fff47cfd935 QuartzCore`CAAnimation_setter(CAAnimation*, unsigned int, _CAValueType, void const*) + 132
    frame #4: 0x00007fff47cfdeca QuartzCore`-[CAAnimation setDuration:] + 45
    frame #5: 0x00007fff47d0314e QuartzCore`-[CALayer addAnimation:forKey:] + 332
    frame #6: 0x00007fff47cb26dc QuartzCore`CA::Layer::remove_sublayer(CA::Transaction*, CALayer*) + 334
    frame #7: 0x00007fff47cb2554 QuartzCore`CA::Layer::remove_from_superlayer() + 126
    frame #8: 0x00007fff3a2f49a4 AppKit`-[NSView _removeLayerFromSuperlayer] + 229
    frame #9: 0x00007fff3a2f431f AppKit`-[NSView _setSuperview:] + 225
    frame #10: 0x00007fff3a2f7b01 AppKit`-[NSView removeFromSuperview] + 149
    frame #11: 0x00007fff3a3dfa88 AppKit`-[NSView removeFromSuperviewWithoutNeedingDisplay] + 36
    frame #12: 0x00007fff3a37dbf5 AppKit`-[NSView _finalize] + 1060
    frame #13: 0x00007fff3a37d64a AppKit`-[NSView dealloc] + 209
    frame #14: 0x00007fff68ce6c8c libobjc.A.dylib`(anonymous namespace)::AutoreleasePoolPage::pop(void*) + 726
    frame #15: 0x00007fff3a9a7b93 AppKit`___NSTouchBarFinderSetNeedsUpdateOnMain_block_invoke + 56
    frame #16: 0x00007fff3cd8495d CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    frame #17: 0x00007fff3cd84892 CoreFoundation`__CFRunLoopDoObservers + 452
    frame #18: 0x00007fff3cd25c82 CoreFoundation`CFRunLoopRunSpecific + 365
    frame #19: 0x00007fff3bfbf895 HIToolbox`RunCurrentEventLoopInMode + 293
    frame #20: 0x00007fff3bfbf4d4 HIToolbox`ReceiveNextEventCommon + 371
    frame #21: 0x00007fff3bfbf348 HIToolbox`_BlockUntilNextEventMatchingListInModeWithFilter + 64
    frame #22: 0x00007fff3a27c95b AppKit`_DPSNextEvent + 997
    frame #23: 0x00007fff3a27b6fa AppKit`-[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1362
    frame #24: 0x00007fff3a27575d AppKit`-[NSApplication run] + 699
    frame #25: 0x00007fff3a264e97 AppKit`NSApplicationMain + 780
    frame #26: 0x000000010004fcd2 ADR ToolBox`main(argc=3, argv=0x00007ffeefbff1e8) at main.m:13
    frame #27: 0x00007fff69dc0085 libdyld.dylib`start + 1
    frame #28: 0x00007fff69dc0085 libdyld.dylib`start + 1

0 个答案:

没有答案
相关问题