1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Simulate TabBar press from ViewController

Discussion in 'iPhone/iPad Programming' started by jjgraz, Apr 27, 2009.

  1. macrumors regular

    jjgraz

    #1
    How do I simulate a TabBar button pressed from within a DetailViewControllers Method.....? The delegate for TabBarController is appDelegate.


    aViewController.m

    Code:
    - (IBAction)buttonPressed:(id)sender{
    *********want to use.......rootController.selectedIndex = 4;********
    	}
    
    It doesn't recognize rootController.

    Thank you.
     
  2. macrumors regular

    jjgraz

    #2
    works with:

    Code:
    
    self. tabBarController.selectedIndex = 0;
    
    
     

Share This Page