0

首先,抱歉,因为我看过一些关于此的帖子,但我无法理解。我的问题是这样的:我有一个从 NSArray 获取值的 UIPickerView。除非我得到选择器第一行的值,否则一切正常。我已经读过方法 - (void) pickerView: (UIPickerView *) pickerView didSelectRow: (NSInteger) row inComponent: (NSInteger) 组件仅在用户在选择器中向上或向下滚动时运行。那么如何在 NSString 中获取选择器的第一个值呢?这是我的方法:

 - (Void) pickerView: (UIPickerView *) pickerView didSelectRow: (NSInteger) row     inComponent: (NSInteger) component
{

 NSLog (@ "are in line% i", row);

 NSLog (@ "You've selected,% @", [array objectAtIndex: row]);

}

我有一个名为“数组”的数组,他包含数据;

非常感谢!

4

1 回答 1

1

很多人都面临过类似的问题(如果人们在 UIPickerView 中选择默认值怎么办),您可能需要查看以下帖子以解决您的特定问题:
https ://stackoverflow.com/a/789633/200272

于 2012-06-14T10:09:21.140 回答