views:

1480

answers:

2

is it UITabBarController possible to select the tab in code?like UINavigationController we can use popViewController pop back to rootViewController instead of press the back button, so how can this implement in tabbarcontroller?

+3  A: 

Use the selectedIndex property on the UITabBarController. More information can be found in the UITabBarController Class Reference.

controller.selectedIndex = 4;

or use

[controller setSelectedIndex:4];

Gerco Dries
that should be [controller setSelectedIndex:4]
Jason Harwig
But that code doesn't trigger tabBarController:didSelectViewController:
goo
A: 

Have you found resolution for trigger tabBarController:didSelectViewController?

awattar