NSPopupButton in NSTableView

I use basic data with updated Xcode. I have a view based table with NSPopupButtonsin one of the columns. There is an array controller in the table that receives its data from object A. There is another array controller for object B. It is this object B that must populate the button elements of the pop-up window.

An NSPopupButtonoutside the table can be populated without problems, so this should be a problem with the table!

How to populate a popup that is inside a column in my table?

Part of the table, with the Popup Button in place.

+3
source share
3 answers

You can do the following:

  • Increase the row height in the table view to 22px or higher.
  • objectValue.menuValues (, -, objectValue).
  • NSPopupButton NSTableCellView.

, objectValue , NSPopupButton, . selector / superview , NSTableCellView, , .

, , . - IB , "n00b", Bindings .

0

, , NSPopupButtonCell . . , . . ArrayController IB B , contentValue B , .

A Value to Table Cell View objectValue. ( A).

0

" ", . ( , Xcode..)

So, my solution uses IBOutlet (currencyCtrl) in File Owner, which is bound to an array controller (in your case for object B). For NSPopupButton, you should use the following bindings:

enter image description here

0
source

All Articles