views:

241

answers:

1

Hi, I want to use two different TabBarController. Everything is declared in my AppDelegate. Here is the result :

TBC1Tab1 | TBC1Tab2 | TBC1Tab3 and then when I push a button my new TabBarController : TBC2Tab1 | TBC2Tab2

Each Tab is linked to a view. I use a button on my first tab to go to my second TabBarController with my new tabs. My problem is to go back to my first TabBarController : how to do it ?

So to have my "back" button I add my code in my views. Then if I use my back button I can't go back to my first view from my first TabBarController. Here is what happens : my view inside my second TabBarController (which is linked to my tab) disappear but my TabBarController doesn't disappear so I can't see my first view with my first TabBarController. Someone know how to do it ? If you don't understand I will add some pictures. thanks

A: 

you need to use two methods in your app delegate

one will work by clicking on your button in tab bar and other will work by clicking on back button

make sure your back button should not be navigation controllers back bar button

that must be custom button

if u have any problem in putting your custom button in the place of back button

put it in right part

thats it other wise if u want to come back it wont work because

navigation controller is the child class of tab bar controller

in NSObject

so

if u want to try with custom button i think u know the answer

other wise call again previous method view did load in 2 nd button

Zach
I'm not sure i understood everything you wrote but what i tried doesn't work. I tried with two different method but if my firstTabBarController is not in my -(void)applicationDidFinishLaunching:(UIApplication *)application {} my application can't load. So i let my firstTabBarController inside and then i used a method with my secondTabBarController but my button back don't work because i don't know which method i should call or what i should write inside...
maxime