views:

30

answers:

1

I'm looking to populate an NSPopupButton with the contents of two NSArrayControllers. The NSArrayControllers are both bound to my Core Data Managed Object Context and represent separate entities (in this example: Person and Department).

Within my NSPopupButton, I would like a list of departments, and the people that work under them. Like so:

Department 1
  Person 1
  Person 2
Department 2
  Person 3
  Person 4

All departments would need to be disabled by default, meaning that users should only be able to select people listed within the dropdown.

I'm lost as to how I would go about doing something like this. The concept of manually populating an NSPopupButton seems fairly trivial, but I'm a bit shaky as to best to populate the element with Core Data objects.

Essentially, I'm just looking for someone to point me in the right direction. I imagine there's a right way to do this, and a number of very wrong ways.

A: 

Why not just populate it manually with the contents of the two NSArrayControllers?

You don't have to use bindings in all circumstances, in fact a lot of the time it's easier not to. Just write a small controller that handles the popup button.

Rob Keniger