私はUINavigationController
を使用していますが、クラスのオブジェクトをクラスのロードだけで作成し、コンポーネントを作成することはしません。 アクションボタンのコードがalloc initはコンポーネントをロードしません
NextView *next = [[NextView alloc] init];
[self.navigationController pushViewController:next animated:YES ];
それは次のUIViewController
になりますが、何の内部コンポーネントは、このようなとしてロードされていない場合は、この私のAppDelegate.m
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
ViewController *vc = [sb instantiateInitialViewController];
UINavigationController *nav = [[UINavigationController alloc] init];
self.window.rootViewController = nav;
nav.viewControllers = @[vc];
とUIViewController
私の最初である - などのボタン、テキストフィールド、。
と私はこのコードをしようとした場合、それは私に、ランタイムエラーを与える
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
NextView *next = [sb instantiateViewControllerWithIdentifier:@"two"];
[self.navigationController pushViewController:next animated:YES ];
あなたはストーリーボードに識別子を指定しましたか? –
どのような種類のランタイムエラーがありますか?質問にログを貼り付けてください。 – kelin
あなたはどのランタイムエラーが発生しますか? – riddhi