【问题标题】:Directly accessing the NSPopupButtonCell of an NSPopupButton (Cocoa OSX)直接访问 NSPopupButton 的 NSPopupButtonCell (Cocoa OSX)
【发布时间】:2010-04-28 04:28:55
【问题描述】:

我知道通常不建议这样做,但我确实需要访问 NSPopupButton 的 NSPopupButtonCell。有没有办法做到这一点?

【问题讨论】:

    标签: cocoa macos nspopupbuttoncell nspopupbutton


    【解决方案1】:
    [myPopup cell];
    

    有点明显,当您考虑时。 ;)

    真的,虽然'; NSPopUpButton : NSButton : NSControl; NSControl-[cell],所以NSPopUpButton 也有。

    我想我想说的是;如果您找不到您正在查看的对象必须具有的方法,请检查其超类。 (或者只是在 Xcode 中使用文本完成和一些幸运的猜测。;)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-21
      • 1970-01-01
      • 2019-01-08
      • 1970-01-01
      相关资源
      最近更新 更多