0

I have a UITextField on main ViewController and once I touch down the Textfield UIPopOverController with UIPickerView opens which is from other class.now I want when I select any value in Pickerview of popovercontroller the selected value should display as UITextfield text and In main Viewcontroller when I pick any value in Pickerview a method calls to print UITextfield text but textfield.text comes always null. but I used the Appdelegate sharedAppdeledatewhich give me value on tapping on pickerview but when i used it to text the textfield it gets null. what should I Do.

and I want to add value on the UITextfield without removing the top view which is pickerview

user2519391
  • 41
  • 1
  • 8

1 Answers1

0

pass your parent class object to your popovercontroller class and you'll be able to have access of the parent class property in child class and then you'll be able to set your textfield value selection on picker from popovercontroller class

D-eptdeveloper
  • 2,430
  • 1
  • 16
  • 30
  • Thanks. I passed the textfield.text value in popovercontroller then its reflecting .. but the when i pass into the parent class then textfield value comes ..null .. can you please explain me this – user2519391 Aug 23 '13 at 04:58
  • add this code in your popovercontroller class - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { objParent.txtState.text = [arrItems objectAtIndex:row]; } here objParent is an object of your parent class and txtState is your textfield. i think this should work for you else you need to paste some code so that i can look at your condition and give you the solution thanks. – D-eptdeveloper Aug 23 '13 at 09:32