2

タブベースのアプリがあり、一部はすべての人が利用できますが、アクセスするにはユーザーを登録する必要があるため、UIViewからLoginに変更したいと思います。

ログインビューは、MainStoryboardの最初のタブに割り当てられます

ここに画像の説明を入力してください

今、私は別のタブ、別のセクション(すでに.xibファイルがあります)にいて、「ログイン」ビューを表示したいと思います。

 Login *aLogin = [[Login alloc] initWithNibName:@"LOGIN" bundle:nil];
 [self presentModalViewController:aLogin animated:YES];

しかし、LOGINxibが存在しないためにクラッシュします。

 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Could not load NIB in bundle: 

「ログイン」uiviewをロードするにはどうすればよいですか?

ありがとう!

4

1 に答える 1

1

見つけた!

 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
 Login *aLogin = [storyboard instantiateViewControllerWithIdentifier:@"Login"];
 [self presentModalViewController:aLogin animated:YES];
于 2012-09-18T13:51:16.730 に答える