我想将导航控制器添加到视图控制器,它是窗口的根视图控制器。两个xib文件主要是window.xib和view controller.xib文件。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}
试过这个
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
self.window.rootViewController = self.viewController;
self.navController = [[UINavigationController alloc] initWithRootViewController:self.viewController];
[self.window addSubview:self.navController.view];
[self.window makeKeyAndVisible];
return YES;
}
但我认为不起作用,因为涉及两个 xib 文件。