我创建了一个基于视图的应用程序,并在 appdelegate .h 文件中创建了 UINavigationcontroller 对象并将其添加到窗口子视图中。应用程序中的下一步确实完成了启动,我已经分配并初始化了一个类,我希望在应用程序第一次启动时查看它,顶部有导航栏。
所以这是我将类添加到导航栏的代码
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
// Add the view controller's view to the window and display.
[window addSubview:navController.view];
//test is the class that i want to be viewed first when the app launches first
test *t = [[test alloc]initWithNibName:@"test" bundle:nil];
[navController.view addSubview:t.view];
[window makeKeyAndVisible];
return YES;
}
但问题是我的测试类启动但它不显示导航栏。可能是什么问题?