简体   繁体   English

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

[英]“Application windows are expected to have a root view controller at the end of application launch” occurred after I disable storyboard

I disabled storyboard by change the Main Storyboard to nothing. 我通过将主故事板更改为空来禁用故事板。 And I have rewrite everything so I don't need a storyboard and it working correctly. 我已经重写了所有内容,因此我不需要故事板并且它正常工作。 But in the console log, Application windows are expected to have a root view controller at the end of application launch occurred. 但是在控制台日志中,应用程序窗口应该在应用程序启动结束时具有根视图控制器。 Could I just ignore the message and They will approve my app after submitted? 我可以忽略该消息吗?他们会在提交后批准我的应用程序吗? The didFinishLaunchingWithOptions: 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;
}

I tried your code, the problem arises from the fact that you reinstantiate the application window, which you don't need to do. 我尝试了您的代码,问题源于您重新实例化您不需要执行的应用程序窗口。 If you just remove that first line of code self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 如果你只删除第一行代码self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; your application should work anyway and the warning should go away. 无论如何,你的申请应该有效,警告应该消失。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程序窗口在应用程序启动结束时有望具有一个根视图控制器 - Application windows are expected to have a root view controller at the end of application launch 应用程序窗口应该在应用程序启动结束时有一个根视图控制器(Iphone 应用程序) - Application windows are expected to have a root view controller at the end of application launch (Iphone App) 出现“在应用程序启动结束时,应用程序窗口应具有根视图控制器”错误 - Getting “Application windows are expected to have a root view controller at the end of application launch” error iPhone 6.0模拟器:应用程序窗口应在应用程序启动结束时具有根视图控制器 - iPhone 6.0 Simulator : Application windows are expected to have a root view controller at the end of application launch “应用程序窗口应该在应用程序启动结束时具有根视图控制器”仅在iPad上出错 - “Application windows are expected to have a root view controller at the end of application launch” error only on iPad iOS:在控制台上获取此消息(而不是错误) - 应用程序窗口应在应用程序启动结束时具有根视图控制器 - iOS: Getting this message (not an error) on console- Application windows are expected to have a root view controller at the end of application launch 应用程序窗口应在应用程序末尾具有根视图控制器 - Application windows are expected to have a root view controller at the end of application 运行RootviewController错误的应用程序-在应用程序启动结束时,应用程序应具有根视图控制器 - Application running with RootviewController error- Applications are expected to have a root view controller at the end of application launch 应用程序窗口应具有根视图控制器 - Application windows are expected to have a root view controller 预计应用程序将在应用程序启动结束时在控制台中显示根视图控制器 - Applications are expected to have a root view controller at the end of application launch disaplying in console
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM