Ios5 如何使用tabbarcontroller在应用程序加载时分离视图控制器

Ios5 如何使用tabbarcontroller在应用程序加载时分离视图控制器,ios5,storyboard,tabbarcontroller,Ios5,Storyboard,Tabbarcontroller,我使用tabbarcontroller作为根视图控制器。不幸的是,使用新的情节串连板功能,很难在应用程序加载上分离视图控制器-登录页面 我正在使用以下代码: - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { UITabBarController *tabBarController = (UITabBarControl

我使用tabbarcontroller作为根视图控制器。不幸的是,使用新的情节串连板功能,很难在应用程序加载上分离视图控制器-登录页面

我正在使用以下代码:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;

    [tabBarController performSegueWithIdentifier:@"loginPage" sender:self];
segue设置正确。我进入其中一个选项卡视图控制器并执行了iAction,它成功地切换。
提前谢谢

今天遇到了同样的问题。我不得不打电话:

[self.window makeKeyAndVisible];
以前

[self.window.rootViewController performSegueWithIdentifier:@"LoginView" sender:self];

因此,我假设在使用故事板时,makeKeyAndVisible发生在didFinishLaunchinWithOptions:returns之后。因此,当我们调用segue时,它发生在一个不在屏幕上的视图上

我最近遇到了同样的问题。然而,提供的解决方案对我来说并不可行

原因是我使用了一个“推”序列来显示我的登录视图控制器(它嵌入在导航控制器中)。将segue的风格从“推送”改为“模态”对我来说很管用。显然,不可能从选项卡栏控制器内启动“推”序列,而只能从导航控制器内启动

此外,我没有把线

[self performSegueWithIdentifier:@"LoginSegue sender:self];
在应用程序代理的方法
didFinishLaunchingWithOptions:didFinishLaunchingWithOptions:
中,而是在方法
viewdid中出现:
。这样做,我不需要以下代码行:

[self.window makeKeyAndVisible];

希望这对其他人有用。

太棒了。。。我到处都找不到答案