Is it possible to have the values displayed in an NSComboBox be different from what is retrieved with objectValueOfSelectedItem?
So, it will display an object's string name but it's int recordId is returned instead of the string name? Other than using selected index and getting it from the source array, of course...
Are you looking for
NSPopUpButton
? It's more similar to an HTML<select>
. AnNSComboBox
lets users directly type in new values, as well as pick them from a list, but you can't do that with plain HTML.In any event, you should be able to give either control a bunch of custom objects that have a
recordid
property, and then retrieve the selection using[[comboBox objectValueOfSelectedItem] recordid]
. You'll also need to write a custom formatter for these objects.