0

我正在尝试使用字符串列表填充 NSPopUpButtonCell。在 -(init) 中,我使用 PopUp Button 中所需的值填充 NSArray。如何将它连接到我在 IB 中添加的 NSArrayController?我的应用程序委托需要一个 IBOutlet NSArrayController 来连接还是有办法绑定它?

另外,当我将 NSArrayController 绑定到 NSPopUpButtonCell 时,我将它绑定到哪个内容?内容还是内容价值?

乔吉

4

1 回答 1

1

Bind the array controller's Content Array to your controller's array of strings. Bind both the pop-up button cell's Content and Content Values to your array controller's arrangedObjects.

Presumably, you also want to know which of these strings is selected. To do that, bind the pop-up button cell's Selected Object (which will be one of the objects in Content) to a property of your controller (the one that owns the original array).

于 2010-04-12T01:50:44.953 回答