I also noticed this error and fixed it differently. The correct value can be obtained when we read the value in the next run of the main run cycle after calling the comboBoxSelectionDidChange method, as shown below.
- (void)comboBoxSelectionDidChange:(NSNotification *)notification{ [self performSelector:@selector(readComboValue:) withObject:[notification object] afterDelay:0]; } - (void)readComboValue:(id)object { NSString *comboValue = [(NSComboBox *)object stringValue]; NSLog(@"%@", comboValue); }
gives the desired result
source share