应用程序窗口应在应用程序启动结束时具有根视图控制器

应用程序窗口应在应用程序启动结束时具有根视图控制器

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

问题描述

我的应用启动时出现上述错误。以下代码来自我的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;

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

08-22 13:57