本文介绍了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:
I got the selected value using:
NSString *strValue = [comboBox itemObjectValueAtIndex:[comboBox indexOfSelectedItem]];更多推荐
comboBoxSelectionDidChange 给了我以前选择的值
发布评论