objective-ccocoaibactionnscombobox

NSComboBox - item selected action?


is there an IBAction for item selection in NSComboBox?

I trying to define 2 different actions - one for item selected from the drop box, and another action for entering a new value. is that possible?

*I'm doing a mac app, not iOS


Solution

  • I believe you can distinguish between the two events in your delegate, but not through an IBAction. The NSComboBoxDelegate protocol responds to the selector - (void)comboBoxSelectionDidChange:(NSNotification *)notification. You can use this to determine when an item was selected from the drop box, and use the text editing delegate selector - (void)controlTextDidEndEditing:(NSNotification *)aNotification to determine when the user entered text directly.