开发者

UIPickerView in iOS, obtain text from row in different component

开发者 https://www.devze.com 2023-03-22 03:58 出处:网络
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 w

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

精彩评论

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