私はこの質問が何度か聞かれたことを知っており、このトピックに関する既存の投稿を読みましたが、それでも助けが必要です。
私には2-UIViewControllers
親と子がいます。以下のように子UIViewController
を表示presentModalViewController
します。
ChildController *child =
[[ChildController alloc] initWithNibName:@"ChildView" bundle:nil];
[self presentModalViewController:child animated:YES];
[child release];
子ビューには。がありUIPickerView
ます。ユーザーがアイテムを選択してUIPickerView
[完了]をクリックすると、モーダルビューを閉じて、選択したアイテムをUITextField
親ビューのに表示する必要があります。
子供のボタンクリックdelegate
で、私は次のことを行います。
ParentController *parent =
(ParentController *)[self.navigationController parentViewController];
[parent.myTextField setText:selectedText];
[self dismissModalViewControllerAnimated:YES];
すべてがエラーなしで機能します。しかし、更新されたを表示するように親ビューをロードする方法がわかりませんUITextField
。
私は試した
[parent reloadInputViews];
動作しません。助けてください。