Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/93.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 如何在Interface Builder中创建UITableViewController作为根用户的UINavigationController?_Iphone_Ios_Xcode_Xcode4_Interface Builder - Fatal编程技术网

Iphone 如何在Interface Builder中创建UITableViewController作为根用户的UINavigationController?

Iphone 如何在Interface Builder中创建UITableViewController作为根用户的UINavigationController?,iphone,ios,xcode,xcode4,interface-builder,Iphone,Ios,Xcode,Xcode4,Interface Builder,1) 在我的应用程序委托中,我创建了根视图控制器,它是一个导航控制器: self.navigationController = [[UINavigationController alloc] initWithNibName:@"RootNavigationController" bundle:nil]; self.window.rootViewController = self.navigationController; 2) “RootNavigationController.xib”创建一

1) 在我的应用程序委托中,我创建了根视图控制器,它是一个导航控制器:

self.navigationController = [[UINavigationController alloc] initWithNibName:@"RootNavigationController" bundle:nil];
self.window.rootViewController = self.navigationController;
2) “RootNavigationController.xib”创建一个
UINavigationController
。它还定义了根视图控制器,它是一个
CatsViewController:UITableViewController
。有一个CatsViewController文件和一个带有UITableViewController根对象的“CatsViewController.xib”。正如您在这个屏幕截图中看到的,我相应地设置了NIB名称:

问题是,即使存在CatsViewController.xib文件,Xcode也不允许我从下拉列表中选择CatsViewController。我希望UINavigationController的XIB创建一个CatsViewController实例作为其根,并希望通过一个单独的nib文件配置此根控制器

Xcode警告:


有办法吗?

您遇到的错误是由于AppDelegate中的
didfishLaunchingWithOptions
方法试图初始化窗口,而不是仅仅返回YES

另外,在代码中更改RootNavigationController,如:

self.navigationController = [[UINavigationController alloc] initWithNibName:@"RootNavigationController" bundle:nil];
换成

self.navigationController = [[UINavigationController alloc] initWithNibName:@"CatsViewController" bundle:nil];