Friday, 13 August 2010

uipicker component and row selection


hello,

i'm quite new iphone programming , can figure out , code working cant seem working. wonder if can !!!


have uipicker 2 components. 0 & 1

want text label display information related uipicker row combination. example if select row 37 on component 0 , row 2 on component 1 display info different if selected row 12 on component 0 row 1 on component 1.

can show text related first component nothing when selecting component 1.

component 0 loaded array constant.
component 1 loaded different arrays depending on selected row in component 0.

below i've got , 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 asking how write combination of (component 0 row + component 1 + row ) ???


thank
 

two things:

1) code supplied reside? how used?

2) talk having arrays load components don't use them in code-snippet. why not?
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

No comments:

Post a Comment