开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜