I have a tab bar application. One of the tabs has a navigation stack. I would like to change tabs programatically and then push a new controller onto the selected tabs stack. I can change tabs fine:
KidScienceAppDelegate *appDelegate = (KidScienceAppDelegate*) [[UIApplication sharedApplication] delegate];
UITabBarController *tab=[appDelegate tabBarController] ;
tab.selectedIndex=2;
If I just run that, it properly move to the tab with the navigation stack and shows the root view. I'd like to then push a new controller onto that stack. I've tried this:
ExperimentsNameViewController *detailViewController = [[ExperimentsNameViewController alloc] initWithNibName:@"ExperimentsNameView" bundle:nil];
FindViewController *c = [tab.viewControllers objectAtIndex:2];
[c.navigationController pushViewController:detailViewController animated:NO];
but this doesn't push the controller. Anyone have any thoughts?