UIViewController parentViewController access properties
- by Dave
I know this question has been asked several times and I did read existing posts on this topic but I still need help.
I have 2 UIViewControllers - Parent and Child. I display the child view using the presentModalViewController as below:
ChildController *child = [[ChildController alloc[ initWithNibName:@"ChildView" bundle:nil];
[self presentModalViewController:child animated:YES];
[child release];
The child view has a UIPickerView. When user selects an item from UIPickerView and clicks done, I have to dismiss the modal view and display the selected item on a text field in the parent view.
In child's button click delegate, I do the following:
ParentController *parent = (ParentController *)[self.navigationController parentViewController];
[parent.myTextField setText:selectedText];
[self dismissModalViewControllerAnimated:YES];
Everything works without errors. But I don't know how to load the Parent View so that it displays the updated text field.
I tried
[parent reloadInputViews];
doesn' work. Please help.