I have a tabBar application with a menu that is called up via a model view controller. Then when you select an option. I want it to dismiss while changing a SelectedIndex of the tabBAr.
here are my code snippets:
FirstTabBarController:
This is what calls the “menu”
-(IBAction)pressedButton {
GWDNativeViewController *secondView = [[GWDNativeViewController alloc] initWithNibName:nil bundle:nil];
[secondView setModalTransitionStyle:UIModalTransitionStyleCoverVertical];
[self presentModalViewController:secondView animated:YES];
}
This is the code to dismiss within the GWDNativeViewController (Menu) view:
-(IBAction)dismissThisView {
//Insert code to dismiss here
[self dismissModalViewControllerAnimated:YES];
[(UITabBarController *)self.parentViewController setSelectedIndex:3];
}
The line:
[(UITabBarController *)self.parentViewController setSelectedIndex:3];
doesn’t seem to be doing the trick..
Try this: