Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>To get the controller, just: </p> <pre><code>[[tabBarController viewControllers] objectAtIndex:indexOfTheTab] </code></pre> <p><code>tabBarController</code> refers to <code>UITabBarController *tabBarController</code> in you AppDelegate.</p> <p>EDIT 1: add this to your AppDelegate.h</p> <pre><code>-(UITabBarController*)getTabBarController; </code></pre> <p>add this to your AppDelegate.m</p> <pre><code>-(UITabBarController*)getTabBarController { return tabBarController; } </code></pre> <p>Now, you can access it from everywhere:</p> <pre><code>[(AppDelegate*)[[UIApplication sharedApplication] delegate] getTabBarController] </code></pre> <p>Don't forget <code>#import "AppDelegate.h"</code></p> <p>EDIT 2: In you AppDelegate.m</p> <p>In the first method, just add: <code>self.tabBarController.delegate = self;</code></p> <p>Then, override:</p> <pre><code>- (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController { //something like : [tabBarController hideTheStuffs]; } </code></pre> <p>With EDIT 2 you can listen to the user touches in the tab bar, even if the tab item is already the current one. With EDIT 1 you can access your delegate from everywhere if needed.</p> <p>EDIT 3:</p> <p>Do you have a <code>IBOutlet UIWebView *myWebView</code> in you ControllerView.h (the one with the view that shows the web view). If not, add this outlet, then connect it to your webview in interface builder.</p> <p>In the controller, add a method in .h and .m :</p> <p><code>-(void)hideTheWebView { myWebView.hidden = YES; }</code></p> <p>As this method is declared in the interface (.h), you can call it from the AppDelegate, method tabBarController:didSelectViewController.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload