Change Tab Dynamically in iPhone using Storyboard Tabbar Application [duplicate]
-
24-07-2021 - |
Question
Possible Duplicate:
Programmatically pressing a UITabBar button in Xcode
I've four tabs in Main tabbar controller. On 1st Tab, there is "Dashboard" Page which is displayed when User registered with Device-ID.
For non-existing Users, It'll prompt a message for Registration. And By clicking on "OK" button, I want to jump on 4th Tab which is used for Set-Up module.
So, how can I set Tabbar index as done with older earlier versions and navigation in Tabbar ?
Please tell me any Solution.
Thanks in Advance.
Solution
Execute the following line of code to get the tabBar begin with the 4 th tab selected when it will be presented
[tabBarController setSelectedIndex:3];
OTHER TIPS
You have to implement this code first If you are using Tabbar based Application in Storyboard.
UITabBarController *tabBar = (UITabBarController *)self.window.rootViewController;
Then,
[tabBar setSelectedIndex:3];
As you said : AppleDelegate