ビュー ベースのアプリケーションを作成し、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;
}
問題は私のテストクラスが起動することですが、ナビゲーションバーが表示されません。何が問題なのですか?