Drawing the UIPicker values from multiple components?

Posted by Rob on Stack Overflow See other posts from Stack Overflow or by Rob
Published on 2010-06-10T03:40:50Z Indexed on 2010/06/10 3:42 UTC
Read the original article Hit count: 369

Filed under:
|

I have the UIPicker setup with multiple components and a button below it. Depending on what the user has chosen with the UIPicker determines which new view will be loaded but I am having trouble determining how to extrapolate the information from the picker itself. Right now I have this method being called when the button is pressed:

- (IBAction) buttonPressed {
        if (component:1 == 1 && component:2 == 1) {
                //Load the view number 1.
        } else if (component:1 == 2 && component:2 == 1) {
                //Load the view number 2.
        } else {
                //Load the view number 3.
        }
}

I obviously know that my code is wrong but I hope it gets the point across. I have multiple components and I need to figure out how to use the information that the user is scrolling to on the picker to determine which view to move to. (I know how to load the views, I just commented those in the code to illuminate the problem areas better.)

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c