Simulate TabBar press from ViewController

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

  1. macrumors regular

    jjgraz

    Joined:
    Feb 13, 2009
    #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. thread starter macrumors regular

    jjgraz

    Joined:
    Feb 13, 2009
    #2
    works with:

    Code:
    
    self. tabBarController.selectedIndex = 0;
    
    
     

Share This Page