ビュー コントローラーの 1 つで問題が発生しました。誰かが私を助けてくれることを願っています。私のストーリーボードは、ビュー コントローラーが存在しないかのように動作し、コントローラーに接続できません。
ストーリーボードにカスタム フリーフォーム ビュー コントローラーを作成しました。その目的は、ポップオーバーに表示され、ユーザーがUITextLabel
ポップオーバーの を使用して編集できるようにすることUITextView
です。
以下のコードを使用して、ポップオーバーのビュー コントローラーを動的にインスタンス化しています。
//create a popover with a text view under a label to be edited,
// allowing the user to edit the label with the popover
GLAppDelegate* appDelegate = (GLAppDelegate*)[[UIApplication sharedApplication] delegate];
UIViewController *mvc = (UIViewController *)appDelegate.window.rootViewController;
PopoverTextViewController* textViewController = [mvc.storyboard instantiateViewControllerWithIdentifier:@"popoverTextViewController"];
textViewController.textView.text = ((OutlinedLabel*)v.attributedView).text;
textViewController.label = (OutlinedLabel*)v.attributedView;
[self.popover dismissPopoverAnimated:YES];
self.popover = [[UIPopoverController alloc] initWithContentViewController:textViewController];
[self.popover presentPopoverFromRect:v.attributedView.frame inView:v permittedArrowDirections:UIPopoverArrowDirectionUp|UIPopoverArrowDirectionDown animated:YES];
私が作成したView Controllerは典型的なView Controllerのようです:
私が実行している問題は、オートコンプリートが、アプリで使用できるそのようなビュー コントローラーがないかのように動作することです。ここに名前を手動で貼り付けても、ストーリーボードの textView プロパティをビュー コントローラーに接続できません。
コードをテストすると動作します。ラベルはポップオーバーで編集できますが、テキスト ビューをビュー コントローラーにリンクできないため、ポップオーバー内にテキストを設定できません。
私はあなたの助けに感謝します!