UIViewController parentViewController access properties

Posted by Dave on Stack Overflow See other posts from Stack Overflow or by Dave
Published on 2010-03-09T21:25:37Z Indexed on 2010/03/17 18:41 UTC
Read the original article Hit count: 339

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.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about parentviewcontroller