我正在尝试为我的课程制作一个Iphone应用程序并且我得到了错误
2015-06-26 00:41:31.721 My Movies[3313:6954045] Application windows are expected to have a root view controller at the end of application launch
我目前正在使用Xcode 6.3.2(6D2105)
这是我的AppDelegate.m完成启动选项部分看起来像
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame: [[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor blackColor];
// Create Film TableView and add it to Navigation Controller, then add Nav'Controller to Window
FilmTableTableViewController *vc = [[FilmTableTableViewController alloc] initWithStyle:UITableViewStylePlain];
navController = [[UINavigationController alloc] initWithRootViewController:vc];
[[self window] addSubview:[navController view]];
[self.window makeKeyAndVisible];
return YES;
答案 0 :(得分:0)
不要将navcontroller添加为子视图。 用
替换它// [[self window] addSubview:[navController view]];
[self.window setRootViewController:navController];