I have an app that I am currently making that has a PickerView and a UIButton. I want the user to tap the button and make the picker view show a random selection. I have been looking around and can’t seem to come up with anything. I guess it would be similar to the Urbanspoon app. I know it is just a piece of a code but I can’t think of what it could be.
Share
You are looking for – selectRow:inComponent:animated:
So do something like this:
where numRows is the number of rows. If the rows are associated with an array names
rowArrayfor instance it would be: