objective c - UITabBarController and switching from one tab to another through code -


I have a UITabBarController that controls two tabs, main and settings.

Now, I would like, to switch some settings below the settings tab from the main tab (such that the user has to do this before using the app).

I know that I can do this with AppDelegate, but my situation may be when I am running in main view.

I have tried to do something like this:

  AppDelegate * delegate = [[UIApplication sharedApplication] representative]; Delegate.rootController.selectedIndex = 1;  

Where the root controller is a UTTB controller defined in my appellate.

The result of the above code is that the tab changes (like the settings tab is actively shown) but it still shows the main view.

I'm sure this is a simple solution that I should remember ...

All suggestions are appreciated.

You have tried:

  self.tabBarController.selectedIndex = 1;  

Controller in the first view?


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -