“禁用故事板后,应用程序窗口应在应用程序启动结束时具有根视图控制器”

时间:2013-05-08 11:35:14

标签: iphone storyboard uiwindow uiapplication

我通过将主故事板更改为空来禁用了故事板。我已经重写了所有内容,因此我不需要故事板并且它正常工作。但是在控制台日志中,应用程序窗口应该在应用程序启动结束时具有根视图控制器。 我可以忽略该消息吗?他们会在提交后批准我的应用程序吗? didFinishLaunchingWithOptions:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];  
    self.tabBarController = [[AKTabBarController alloc] initWithTabBarHeight:65];
    SubscribeViewController *sub = [[SubscribeViewController alloc] initWithNibName:nil bundle:nil];
    UINavigationController *navControlelr = [[UINavigationController alloc] initWithRootViewController:sub];
    NewHomeViewController *home = [[NewHomeViewController alloc] initWithNibName:nil bundle:nil];
    UINavigationController *homeNav = [[UINavigationController alloc] initWithRootViewController:home];

    ReceivedPushViewController *receivedPush = [[ReceivedPushViewController alloc] initWithNibName:nil bundle:nil];

    MoreViewController *more = [[MoreViewController alloc] initWithNibName:nil bundle:nil];

    NSMutableArray *viewControllers = [NSMutableArray arrayWithArray:@[homeNav, navControlelr, receivedPush, more]];

    [self.tabBarController setViewControllers:viewControllers];
    [self.window setRootViewController:self.tabBarController];
    [self.window makeKeyAndVisible];

    return YES;
}

1 个答案:

答案 0 :(得分:2)

我尝试了您的代码,问题源于您重新实现应用程序窗口这一事实,您不需要这样做。如果您只删除第一行代码self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];,那么您的应用程序应该可以正常工作,并且警告应该消失。