本文介绍了comboBoxSelectionDidChange给我以前选择的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将此通知用于NSComboBox.唯一的问题是,当我在下拉列表中选择其他项目时,它始终会在组合框中显示以前选择的值.如何获得当前选择的值.我需要根据值使一些控件启用/禁用.
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] ); }推荐答案
我使用以下方法获得了所选值:
I got the selected value using:
NSString *strValue = [comboBox itemObjectValueAtIndex:[comboBox indexOfSelectedItem]];更多推荐
comboBoxSelectionDidChange给我以前选择的值
发布评论