views:

211

answers:

1

I have a UITabBarController as my MainWindow.xib. I have 3 tab bar items on the tab bar. On the second tab bar item, i have placed a UIButton. When the user taps the button, i want to be able to switch to the first tab bar item and display the view loaded there. How would i do this programmatically?

Thanks

A: 

You can use UITabBacController's selectedViewController property if you have a reference to the view controller you want to switch to, or you can use selectedIndex if your tabs have a static order and you know which index to switch to.

Ben S