【问题标题】:Detecting tab view change Xcode OSX AppleScriptObjC检测选项卡视图更改 Xcode OSX AppleScriptObjC
【发布时间】:2013-05-26 17:08:42
【问题描述】:

我正在 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
)

任何帮助将不胜感激!

【问题讨论】:

    标签: xcode macos events applescript applescript-objc


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-04
      • 1970-01-01
      • 2015-09-18
      • 1970-01-01
      相关资源
      最近更新 更多