Search code examples
iphoneiosios4

iOS change tab programmatically


I'm developing an iOS application with a tab bar and navigation. When I press a button in the first tab I want it to load the second tab with a navigation controller and push the next view. Can someone help with this?


Solution

  • The button in the first tab sends a message to the tab controller, telling it to select the second tab. Then you send a message to the rootView of the second tab, which is a navigation controller, and tell it to push such and such an object that you create in the class with the first button.