I'm hoping that I'm just stupid and this is actually a simple problem, but I can't figure it out. Here's my situation:
I've got an NSArrayController whose datasource is an array of Coin objects. Each Coin has various attributes, each of which is bound to a column of an NSTableView. However, I don't want my table to be editable, so for each instance variable of the Coins, I've got an editable NSTextField also bound to the appropriate key of the selected object in the table. In this way, the table lets me see the objects, but to edit one I select it and use the text fields. Pretty standard stuff.
One of the instance variables (NSString *mint) of the Coin class is unique in that it should only ever take one of three specific values ("Philadelphia," "Denver," or "San Francisco"), so instead of using a text field to edit this one, I'd like to have a pop up button from which the user can select the appropriate mint location. Each new Coin is initialized with Philadelphia as its mint.
I've read the Apple documentation on NSPopUpButton bindings, but I can't make heads or tails of it. I'd be really grateful if someone could point me in the right direction here.
I've got an NSArrayController whose datasource is an array of Coin objects. Each Coin has various attributes, each of which is bound to a column of an NSTableView. However, I don't want my table to be editable, so for each instance variable of the Coins, I've got an editable NSTextField also bound to the appropriate key of the selected object in the table. In this way, the table lets me see the objects, but to edit one I select it and use the text fields. Pretty standard stuff.
One of the instance variables (NSString *mint) of the Coin class is unique in that it should only ever take one of three specific values ("Philadelphia," "Denver," or "San Francisco"), so instead of using a text field to edit this one, I'd like to have a pop up button from which the user can select the appropriate mint location. Each new Coin is initialized with Philadelphia as its mint.
I've read the Apple documentation on NSPopUpButton bindings, but I can't make heads or tails of it. I'd be really grateful if someone could point me in the right direction here.