开发者

How can I get multiple arrays into UIPickerview

开发者 https://www.devze.com 2023-02-19 18:02 出处:网络
I have an problem in UIPickerview, it is displayed in this screenshot. Screenshot of my UIPickerView I have three arrays. Each array is 开发者_C百科passed into UIPickerview. I can display the three

I have an problem in UIPickerview, it is displayed in this screenshot.

Screenshot of my UIPickerView

I have three arrays. Each array is 开发者_C百科passed into UIPickerview. I can display the three columns in UIPickerview.

My problem is that the arrays are not passed into each column and are not passed into the sub-columns.

How can I solve the problem? Please help me.


In UIPickerView delegate:

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent (NSInteger)component

check for

if(component == 0)

{

   //use Array1

}

else if(component == 1)

{

   //use Array2

}

else if(component == 2)
{

   //use Array3

}
0

精彩评论

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