objective c - iOS UIPickerView how to get the selected row outside the delegate method -
i know uipickerview has method:
- (void)pickerview:(uipickerview *)pickerview didselectrow:(nsinteger)row incomponent:(nsinteger)component
but inside method, want selected row of other components. how on earth can that?
you can selected row number anywhere using selectedrowincomponent method of uipickerview
.
such like
nsstring *yourselectedtitle = [self.yourarrayname objectatindex:[self.yourpickername selectedrowincomponent:0]]; nslog(@"%@", yourselectedtitle);
Comments
Post a Comment