UIPickerView in iOS, obtain text from row in different component
i need to obtain the text from a specific row of the picker !!the delegate didSelect does not work, because after reloading components variable that i am getting its that information before the data was reloaded. I need to obtain the data by calling 开发者_C百科a function. Thanks in advance !!
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
{
return [yourArray objectAtIndex:row];
}
If you want from the picker to an NSString, you just check which row is selected, and then get the string at the corresponding row-index in yourArray
精彩评论