0

我正在 AppleScriptObjC 中构建一个应用程序,并且我有一个初学者问题 - 我如何处理单击我的应用程序中的选项卡按钮?我正在尝试使其每个选项卡具有不同的大小。我可以调整窗口大小,但不能在您单击选项卡时调整。无论如何,我已将选项卡视图连接到委托 在此处输入图像描述

等等,并添加了didSelectTabView如下功能:

on didSelectTabViewItem_(tabItem)
    display alert "Testing"
end didSelectTabViewItem_

...我收到以下错误:

2013-05-30 18:50:10.970 MacUtil[16354:303] Error setting value for key path self of object <AppDelegate @0x1005d3040: OSAID(4)> (from bound object <NSTabView: 0x101c05490>): [<AppDelegate 0x1005d3040> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key self.
2013-05-30 18:50:10.972 MacUtil[16354:303] (
    0   CoreFoundation                      0x00007fff911210a6 __exceptionPreprocess + 198
    1   libobjc.A.dylib                     0x00007fff9522e3f0 objc_exception_throw + 43
    2   CoreFoundation                      0x00007fff91120ee8 +[NSException raise:format:arguments:] + 104
    3   AppKit                              0x00007fff92e3414c -[NSBinder _setValue:forKeyPath:ofObject:mode:validateImmediately:raisesForNotApplicableKeys:error:] + 902
    4   AppKit                              0x00007fff92e33d6d -[NSBinder setValue:forBinding:error:] + 248
    5   AppKit                              0x00007fff93493625 -[NSViewStateBinder _setValue:forBinding:errorFallbackMessage:] + 63
    6   AppKit                              0x00007fff933a5198 -[NSTabViewBinder tabView:didSelectTabViewItem:] + 330
    7   AppKit                              0x00007fff934b9c75 -[_NSBindingAdaptor tabView:didSelectTabViewItem:] + 136
    8   AppKit                              0x00007fff92fe9029 -[NSTabView selectTabViewItem:] + 1172
    9   AppKit                              0x00007fff9303ea8c -[NSTabView mouseDown:] + 156
    10  AppKit                              0x00007fff92fad60e -[NSWindow sendEvent:] + 6853
    11  AppKit                              0x00007fff92fa9744 -[NSApplication sendEvent:] + 5761
    12  AppKit                              0x00007fff92ebf2fa -[NSApplication run] + 636
    13  AppKit                              0x00007fff92e63cb6 NSApplicationMain + 869
    14  MacUtil                             0x0000000100000f0a main + 74
    15  libdyld.dylib                       0x00007fff93a297e1 start + 0
    16  ???                                 0x0000000000000003 0x0 + 3
)

任何帮助,将不胜感激!

4

1 回答 1

0

解决了!我只需要在将其绑定到应用程序委托的地方取消选中“不适用密钥的提升”。这样做是因为我还没有实现选项卡视图事件处理的所有方法。

于 2013-05-31T00:10:35.047 回答