PickerView show a especifi value

Discussion in 'iOS Programming' started by joak, Apr 16, 2014.

  1. joak macrumors newbie

    Joined:
    Mar 7, 2014
    #1
    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.
     
  2. mds1256 macrumors regular

    Joined:
    Apr 9, 2011
    #2
    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.
     
  3. joak thread starter macrumors newbie

    Joined:
    Mar 7, 2014
    #3
    Let me see if I understand ......

    I have to "work" in the array to the first "element" is equal to this player name?
     
  4. MattInOz macrumors 68030

    MattInOz

    Joined:
    Jan 19, 2006
    Location:
    Sydney
    #4
    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.
     
  5. joak thread starter macrumors newbie

    Joined:
    Mar 7, 2014

Share This Page