我已經創建了一個基於視圖的應用程序,並在appdelegate .h文件中創建了UINavigationcontroller對象並將其添加到窗口subview.Application下一步完成啓動我已分配和初始化,我想,當應用程序首先在它的頂部的導航欄啓動被視爲一類。 所以這是代碼,我做的類添加到導航欄如何調用導航控制器上的另一個類,並將其添加到應用程序代理
- (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;
}
但問題是我的測試類的推出,但它不會顯示在導航欄。 什麼可能是這個問題。請幫助我解決這個問題。謝謝
喜ishu,我的代碼工作正常的委託類,但如果我想調用另一個控制器上的導航欄什麼.Thanks – Rani 2011-04-28 08:03:18
看到更新的答案。 – Ishu 2011-04-28 09:55:32
感謝現在可以正常工作 – Rani 2011-04-28 11:10:52