代码之家  ›  专栏  ›  技术社区  ›  Phillip Mills

不存在用户定义的运行时属性

  •  0
  • Phillip Mills  · 技术社区  · 7 年前

    我有一个简单的Mac应用程序,在打开文档时收到以下错误: 无法设置(PKMPDFView):[设置值:forUndefinedKey:]:对于键allowsDraging,此类不符合键值编码。

    如果我截获“set”尝试,我会看到它源自方法 -[NSIBUserDefinedRuntimeAttributesConnector建立连接] 在笔尖加载期间。

    完整跟踪:

    0   PDFApp                              0x0000000100003592 -[PKMPDFView setValue:forUndefinedKey:] + 49
    1   Foundation                          0x00007fff309b8dde -[NSObject(NSKeyValueCoding) setValue:forKey:] + 331
    2   AppKit                              0x00007fff2c08af15 -[NSView setValue:forKeyPath:] + 394
    3   AppKit                              0x00007fff2c00d029 -[NSIBUserDefinedRuntimeAttributesConnector establishConnection] + 637
    4   AppKit                              0x00007fff2bdd9719 -[NSIBObjectData nibInstantiateWithOwner:options:topLevelObjects:] + 1430
    5   AppKit                              0x00007fff2bdd0991 loadNib + 435
    6   AppKit                              0x00007fff2bdcfeb5 +[NSBundle(NSNibLoading) _loadNibFile:nameTable:options:withZone:ownerBundle:] + 696
    7   AppKit                              0x00007fff2c005aba +[NSBundle(NSNibLoadingInternal) _loadNibFile:externalNameTable:options:withZone:] + 150
    8   AppKit                              0x00007fff2c005893 -[NSWindowController loadWindow] + 322
    9   AppKit                              0x00007fff2be18cf5 -[NSWindowController window] + 84
    10  AppKit                              0x00007fff2bfd8134 -[NSWindowController showWindow:] + 36
    11  AppKit                              0x00007fff2be18c7a -[NSDocument showWindows] + 116
    12  PDFApp                              0x0000000100002e75 -[PKMPDFDocument showWindows] + 50
    13  AppKit                              0x00007fff2c35f13e __80-[NSDocumentController openDocumentWithContentsOfURL:display:completionHandler:]_block_invoke.1039 + 182
    14  AppKit                              0x00007fff2c36ef70 ___NSMainRunLoopPerformBlock_block_invoke + 25
    15  CoreFoundation                      0x00007fff2e897a3c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
    16  CoreFoundation                      0x00007fff2e87a973 __CFRunLoopDoBlocks + 275
    17  CoreFoundation                      0x00007fff2e879ffe __CFRunLoopRun + 1278
    18  CoreFoundation                      0x00007fff2e879867 CFRunLoopRunSpecific + 487
    19  HIToolbox                           0x00007fff2db59d96 RunCurrentEventLoopInMode + 286
    20  HIToolbox                           0x00007fff2db59b06 ReceiveNextEventCommon + 613
    21  HIToolbox                           0x00007fff2db59884 _BlockUntilNextEventMatchingListInModeWithFilter + 64
    22  AppKit                              0x00007fff2be09a73 _DPSNextEvent + 2085
    23  AppKit                              0x00007fff2c59fe34 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 3044
    24  AppKit                              0x00007fff2bdfe885 -[NSApplication run] + 764
    25  AppKit                              0x00007fff2bdcda72 NSApplicationMain + 804
    26  libdyld.dylib                       0x00007fff56848015 start + 1
    

    PKMPDFView NSView 并且在正在加载的.xib文件中没有与之关联的用户定义属性。此视图也没有在.xib中定义的出口,只是其文档中的引用出口(contentView)。在我的开发目录中运行find/grep,在任何地方都找不到“allowsDragging”的实例。同样,使用strings实用程序在构建的应用程序中不会显示“allowsDragging”。

    我试过所有标准的项目清洁,症状没有变化。

    setValue:forUndefinedKey: 算了吧,但我还是很好奇。有没有人知道或者很好地猜测这是从哪里来的?

    0 回复  |  直到 7 年前