I am switching the tab bar by using following command
self.tabbarcontroller.selectedIndex=0;
this is working but If I am pushing a another view controller then the switch of tab bar is not happening but if I manually select first view controller then I can see pushed view controller is there.
but why the switch is not happening only when another viewcontroller is pushed on top.
FYI: there is no problem with the way I am pushing the view controler on top of the top view controller because I tried commenting the code for switch the tab bar item and its getting pushed without any problem.
Any help is appreciated.
--
Update:
Here is my code to push the view controller
- (UINavigationController*) rootNavigationController {
UITabBarController* tabBarController = (UITabBarController*) [[self window] rootViewController];
return (UINavigationController*) [tabBarController selectedViewController];
}
[rootNavigationController pushViewController:newViewController animated:true];