Hello,
I'm quite new to this iPhone programming and can up to now figure out and get code working but i cant seem to get this working. I wonder if anyone can help !!!
I have a uipicker with 2 components. 0 & 1
I want a text label to display information related to the Uipicker row combination. For example if i select row 37 on component 0 and row 2 on component 1 it will display info which would be different if i selected row 12 on component 0 with row 1 on component 1.
so i can show text related to the first component but nothing when selecting component 1.
Component 0 is loaded with a Array which is constant.
Component 1 is loaded with different arrays depending on the selected row in component 0.
Below is what i've got and cant figure out:
if guess i asking how do i write the combination of (component 0 with row + component 1 + row ) ???
Thank you
I'm quite new to this iPhone programming and can up to now figure out and get code working but i cant seem to get this working. I wonder if anyone can help !!!
I have a uipicker with 2 components. 0 & 1
I want a text label to display information related to the Uipicker row combination. For example if i select row 37 on component 0 and row 2 on component 1 it will display info which would be different if i selected row 12 on component 0 with row 1 on component 1.
so i can show text related to the first component but nothing when selecting component 1.
Component 0 is loaded with a Array which is constant.
Component 1 is loaded with different arrays depending on the selected row in component 0.
Below is what i've got and cant figure out:
Code:
if ((component == 0 && row == 93) && (component== 1 && row ==0)){
[mypickerView selectRow:0 inComponent:1 animated:YES];
[mypickerView reloadComponent:1];
label1.text =[[[NSString alloc] initWithFormat:@"1 hour" ]autorelease]; }
else if ((component==0 && row == 94) && (component==1 && row == 1)){
label1.text =[[[NSString alloc] initWithFormat:@"2 hour" ]autorelease];}
else if ((component==0 && row == 94) && (component==1 && row == 2)){
label1.text =[[[NSString alloc] initWithFormat:@"3 hour" ]autorelease];}
else if ((component==0 && row == 94) || (component==1 && row == 3)){
label1.text =[[[NSString alloc] initWithFormat:@"4 hour" ]autorelease];}
else if ((component==0 && row == 94) || (component==1 && row == 4)){
label1.text =[[[NSString alloc] initWithFormat:@"5 hours" ]autorelease];}
else if ((component==0 && row == 94) || (component==1 && row == 5)){
label1.text =[[[NSString alloc] initWithFormat:@"6 hours" ]autorelease];}
if guess i asking how do i write the combination of (component 0 with row + component 1 + row ) ???
Thank you
Last edited by a moderator: