lundi 29 juin 2015

How to control More navigation controller in tab bar controller

In my application I have a tab bar controller which has been pushed into a navigation controller as it is the third screen of the application. For that I have added a tab bar controller in my story board and created a View controller for that ,which is a sub class of UITabbarcontroller.Then I wrote the following code to push the tab bar controller into the navigation controller.

UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
            UITabBarController *obj=[storyboard instantiateViewControllerWithIdentifier:@"tabBarCon"];
            obj.selectedIndex = 2;
            obj.tabBarItem.title = @"Next Screen";
            [self.navigationController pushViewController:obj animated:YES];

I have 6 tabs in my tab bar.So the last two tab bar items appears in More navigation controller.I have added separate navigation controllers for all the view controllers in tab bar controller.My problems are:

I am not able to set a title for More navigation controller screen , which displays the last two tab bars in a table view.Title is coming as the title of last visited view controller.And When I go back from any of these two view controllers I am directly coming back to my second screen instead of going back to More navigation controller.

Please suggest on this.Please correct me if I am doing anything wrong.

Aucun commentaire:

Enregistrer un commentaire