0
votes

I have a uitabbarController, it has 4 Tabs. Each Tab has its own Navigation Based Stack Trace. A logout button on each screen Presents a Login Screen over my TabbarController.

But when i reLogin then my Tabbar old Stack remains there.

I want that whenever and from which ever screen I presses a Logout button it PopsOut all the View controllers of all tabs to Root View controller.

Can anybody guide me how to achieve this.

Thanks

1

1 Answers

0
votes

Atlast I have solved it.

I created the following criteria and got what i needed. Using the following code you can pop All your Tab bars to their Respective Root View Controllers at One Time.

 NSArray *temp = self.tabBarController.viewControllers;
NSLog(@"count of Temp = %d",[temp count]);
NSLog(@"Temp Array = %@",temp);
if ([temp count]>=1) {
    for (int i=0; i<[temp count]; i++) {
        UINavigationController *controller = [self.tabBarController.viewControllers objectAtIndex:i];
        NSLog(@"controllers @ index %d = %@",i,[controller class]);
        [controller popToRootViewControllerAnimated:YES];
    }
}

Thanks
Best Regards
sHaH...