4

I'm trying to use a popup button within a view based NSTableView, i would like to populate the values for the popup with the array controller "Sectors". I can get this working fine if the popup is within a regular view, however comes up empty inside the Tableview. The bindings for the popup button are below

Popup Bindings

Objects

I searched around and it seems that other people had this problem, but could not locate a viable solution.

Cory
  • 2,302
  • 20
  • 33

1 Answers1

1

I had the same problem, and have just posted an answer to this similar question

NSPopupButton in view based NSTableView: getting bindings to work

You can get it working, and I've posted a sample project on GitHub that demonstrates the difference in bindings necessary to get it working inside a view based NSTableView, compared to what you would normally expect to do.

Basically you need to create an IBOutlet to your array controller within the class that is the table view's delegate, and then bind to that.

Community
  • 1
  • 1
davidb
  • 357
  • 2
  • 9
  • Good job! This the kind of stuff that makes me walk away from bindings. Someone else once said they get you 80-90% of the way there and then for the remainder you have to spend the time equivalent to just not using them. – uchuugaka Jan 11 '14 at 11:40
  • Thanks. I think there is an argument that they're not the most transparent way to hook things up! – davidb Jan 12 '14 at 19:13