How can I get multiple arrays into UIPickerview
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
}
精彩评论