My question is about how to access the TabBarController from within one of its viewControllers.
Imagine a mainClass.m that adds tabBarController which has two viewControllers – viewController1 and viewController2.
In viewController1.m there is a game. When the game is over, viewController1.m wants to tell tabBarController to display viewController2, but viewController1 has no reference to tabBarController. How do I reference the viewController’s parent?
How does one change tabBarItems from within the code for the current view?
Via the tabBarController property of your view controller.
Where “self” is viewController1
tabController property of viewControllers
setViewControllers:animated: method of UITabBarController
Also, technically, the tabBarController is not any view controller’s parent. To say it that way is confusing how inheritance works in Objective-C. Your view controller’s super class, or parent, is UIViewController.