How do something after touching a pickerview item?

Discussion in 'iOS Programming' started by skunkio, May 19, 2010.

  1. skunkio macrumors newbie

    Joined:
    Apr 25, 2010
    #1
    Hi all,
    how can i do "something" when i touch a pickerview item?
    In my app i have a pickerview filled using an array, now, when i touch (select) a specific item i would do another action. I didn't find nothing on google.
    Any idea?

    Ciao,
    stè
     
  2. Svinja macrumors newbie

    Joined:
    Oct 27, 2008
    #2
    Hi,
    you can look all delegate methods for UIPickerView by typing UIPickerViewDelegate in xcode docs...

    the one you need is...
    Code:
    - (void)pickerView:(UIPickerView *)_pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
    {
    }
    
    dont forget to set pickerViews delegate...
     
  3. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #3
    What did you Google for?

    Your first stop should probably have been the documentation for UIPickerView, where the Overview includes this:
    (Emphasis mine).
     

Share This Page