-1

次のコードは、AppDelegate からルート コントローラーを呼び出すために機能します。ただし、別のログインView Controllerに配置すると機能しません。ログインに成功したら、通常の View Controller をロードしたいと思います。ただし、ログイン VC 内では、メイン ビュー コントローラーは読み込まれません。メソッドの NSLog は、それが起動されていることを示していますが、ログイン VC を表示し続けます。

別の VC からルート ビュー コントローラーをロードする正しい方法についてご提案いただきありがとうございます。

    - (void)presentMainInterface
    {
NSLog(@"presenting main interface");
        self.window.rootViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateInitialViewController];
    }
4

1 に答える 1

3

これを試して

UIWindow *window =  [[[UIApplication sharedApplication] windows] firstObject];
window.rootViewController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateInitialViewController];
于 2015-05-21T01:51:31.690 に答える