Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

joak

macrumors newbie
Original poster
Mar 7, 2014
27
0
Hi

I have a pickeView with names of players ...... I want to pickerView show an especif name, generally the pickerView show the "first" name of the array... how can I do this?


Regards.
 

mds1256

macrumors regular
Apr 9, 2011
167
43
Hi

I have a pickeView with names of players ...... I want to pickerView show an especif name, generally the pickerView show the "first" name of the array... how can I do this?


Regards.

It's probably going to be something like:


[myPicker selectRow:0 inComponent:0 animated:YES];

This should select the first component in the picker view. Obviously you will have to load the objects in to it buyer after you have loaded them use the method above on the uipickerview to select the first row.
 

joak

macrumors newbie
Original poster
Mar 7, 2014
27
0
Let me see if I understand ......

I have to "work" in the array to the first "element" is equal to this player name?
 

MattInOz

macrumors 68030
Jan 19, 2006
2,760
0
Sydney
You don't need to change the Array order.
just find which element of the array is the item you want selected.
then set that as the row selected.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.