Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

comboBoxSelectionDidChange gives me previously selected value

I am using this notification for NSComboBox. Only problem is when I select a different item in the dropdown it always show previously selected value in the combo box. How can I get the currently selected value. I need to make some controls enable/disable based on the value.

- (void)comboBoxSelectionDidChange:(NSNotification *)notification {
        NSComboBox *comboBox = (NSComboBox *)[notification object];

        NSLog(@"[comboBox stringValue] : %@", [salaryBy stringValue] );
}
like image 463
Leo Avatar asked Mar 10 '11 20:03

Leo


1 Answers

I got the selected value using:

NSString *strValue = [comboBox itemObjectValueAtIndex:[comboBox indexOfSelectedItem]];
like image 197
Adion Avatar answered Sep 30 '22 07:09

Adion