应用程序窗口应在应用程序启动结束时具有根视图控制器 [英] Application windows are expected to have a root view controller at the end of application launch occured

查看:82
本文介绍了应用程序窗口应在应用程序启动结束时具有根视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用启动时出现上述错误。以下代码来自我的AppDelegate .h文件

Getting the above error when my app launches. The following code is from my AppDelegate .h File

#import <UIKit/UIKit.h>

@interface TableViewAppDelegate : NSObject <UIApplicationDelegate> {

UIWindow *window;
UINavigationController *navigationController;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

@end

以下内容来自我的AppDelegate实施文件.m applicationdidfinishlaunchingwithoptions

The following is from my AppDelegate implementation file .m applicationdidfinishlaunchingwithoptions

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

//Configure and show the window
[window addSubview:[navigationController view]];

[window makeKeyAndVisible];

return YES;
}


推荐答案

在你的app delegate中添加这个:

add this in your app delegate:

self.window.rootViewController = navigationController;

这篇关于应用程序窗口应在应用程序启动结束时具有根视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆