ios - Display UIPicker selection on a label in other View Controller -
working on app ipad has 1 main view controller , 3 popover views, each popover view has uipicker, want display in 3 different labels located in main view controller uipickers selection, each label asociated own uipicker. had been trying delegate objects pass data pickers labels wrong. clue please! thanks.
the easiest way use tags.
typedef enum { firstpicker = 1, secondpicker, thirdpicker } pickertags;
when create picker, indicate 1 setting tag either in storyboard or
picker.tag = firstpicker;
in picker callbacks easy identify picker:
- (void)pickerview:(uipickerview *)pickerview didselectrow:(nsinteger)row incomponent:(nsinteger)component { if (picker.tag == firstpicker) { /* handle first picker */ } // etc. }
Comments
Post a Comment