문제

self.tabBarController.selectedViewController=[self.tabBarController.viewControllers objectAtIndex:3]; 

I used above code to select a tab for UITabBarController, The code selecting correct tab but the view for the tab is still first view. So how can i select both tab and view from code. When i select the selected tab again then only the view is changing to correct view. so how to solve this problem.

도움이 되었습니까?

해결책

If your class is a UITabBarController, just do this :

[self setSelectedIndex:3];

다른 팁

I think this LOC does all the trick:

[self.tabBarController setSelectedIndex:3];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top