uitabbarcontroller - Determining the currently selected TabBarItem from within a tableViewController on the iPhone? -
I have 2 tabs in my tabber. They both have examples of the same UITableViewController
.
Hierarchy
UITabbarController & gt; UINavigationControler & gt; UITableViewController
From the table viewController, I want to determine which tab is currently selected, I know that I have selected the selectedIndex
to UITabBarController < / Code>, I do not know the easiest way to reference from within the current
viewController
. Do I run through the supervision of every view to search
If you instantiate and store UITabBarController in your app representative, you can highlight it as the asset of that object. You can store a stationary global pointer in your App Deliate object and expose it via class method:
+ (MyAppDelegate *) Example {return g_Instance; }
When you need your tabbar controller, you can use it:
[MyAppDelegate instance] .tabBarController
Comments
Post a Comment