我有许多人已经报告过的问题,didSelectViewController没有被调用,但在我的情况下它有时会被调用。我有三个选项卡和三个ViewController。每次用户按下第二个或第三个选项卡时,我都需要执行一些代码。在我的SecondViewController和ThirdViewController中,我有:UITabBarController*tabBarController=(UITabBarController*)[UIApplicationsharedApplication].keyWindow.rootViewController;[tabBarController