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

#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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

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

[window makeKeyAndVisible];

return YES;
}

最佳答案

将此添加到您的应用程序委托中:

self.window.rootViewController = navigationController;

关于ios - 在应用程序启动结束时,应用程序窗口应具有根 View Controller ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/19819730/

10-14 21:55