I have the problem that many already have reported, didSelectViewController
doesn't get called, but in my case it sometimes gets called. I have three tabs and three view controllers. Every time user presses second or third tab I need to execute some code. In my SecondViewController and ThirdViewController I have:
UITabBarController *tabBarController = (UITabBarController *)[UIApplication sharedApplication].keyWindow.rootViewController;
[tabBarController setDelegate:self];
Now everything works fine with the SecondViewController, the didSelectViewController
gets called every time the second tab is pressed. Also in ThirdViewController didSelectViewController
gets called every time the third tab is pressed but only when second bar is meanwhile not pressed. So when I switch back and forth between FirstViewController and ThirdViewController everything is OK. But when I go in a pattern like first->second->third, then didSelectViewController
doesn't get called in ThirdViewController. Also when I go like first->third->second->third didSelectViewController
gets called in ThirdViewController the first time but not the second time. Any ideas?