Passing PickerView selected value to prior view

Discussion in 'iOS Programming' started by Kire, Jun 28, 2012.

  1. Kire macrumors newbie

    Jun 28, 2012
    If someone could help me out I would be very appreciative.

    I have a view with a UItextView on it that when touched will push a new view with a PickerView on it which is designed to set the value of the original textbox, sort of acting as a drop down box.

    What I am currently trying to do is this:

    on view with pickerview, I have a strong property NSString called PickerViewValue.

    on that view, on PicerView didSelectRow, I am setting a property on that viewcontroller = to the pickerView selected row value

    On the original view, before I push, I am setting a local variable to the property on the view i am about to push to.

    Then, on the original view, in viewWillAppear I am trying to set the text of the text box to the local variable I set.

    It's not working, is there a way to do this?
  2. cMacSW macrumors regular

    Mar 20, 2006
    In the debugger is the value right? I'm guessing that the property in the orginal view is not set as you may expect.
  3. Kire thread starter macrumors newbie

    Jun 28, 2012
    In the view with the pickerView, yes, it is correct in debugger.

    In the view I am trying to get it into, it's null, it's not coming over through the pointer that I tried to set.
  4. cMacSW macrumors regular

    Mar 20, 2006
    I would check that the viewcontroller pointer is valid here and copy the string value to the viewcontroller variable.

Share This Page