我有一個非常簡單的問題。我有一個視圖控制器。在視圖控制器中,我添加了幾個按鈕。點擊按鈕時,我必須啓動一個標籤欄控制器(其中每個都有導航控制器)。Iphone:無法從導航欄控制器返回
代碼段:
- (IBAction) pushNewsAlertsController:(id)sender {
//Create a navigation controller
UINavigationController *FirstNavController = [[UINavigationController alloc] init] ;
//create the view controller (table view controller)
FirstViewController *firstViewController = [[FirstViewController alloc] init];
[FirstNavController pushViewController:firstViewController animated:YES];
//Create a navigation controller
UINavigationController *secondNavController = [[UINavigationController alloc] init] ;
//create the view controller (table view controller)
SecondViewController *secondViewController = [[SecondViewController alloc] init];
[secondNavController pushViewController:secondViewController animated:YES];
// Set the array of view controllers
tabBarController.viewControllers = [NSArray arrayWithObjects:firstNavController, secondNavController, nil] ;
//Add the tab bar controller's view to the window
[self.view addSubview:tabBarController.view];
}
我能夠加入tabviews和導航控制器。問題是一旦按鈕被點擊,我無法回到主視圖。
任何人都可以指導我如何回到以前的視圖,以便我可以點擊其他按鈕。
感謝您的回答。我通讀了指南並現在實施了應用程序和導航工作。 – Pintu 2011-02-18 00:37:13