I have an application that uses a UITabBar when my app loads VC1 loads (ViewController number 1) but I have a button in this precise viewcontroller that needs a map that is in VC2 but if the user never clicked the second button on the tabBar VC2 was never loaded and therefore The map isn’t even there!
i tried to use[(VC2 *) [self.tabBarController.viewControllers objectAtIndex:1] viewDidLoad] but VC2.mapView is still nil after that. Any Idea how can I get to that mapview in that situation?
I have an application that uses a UITabBar when my app loads VC1 loads
Share
Assuming the controller array reference is correct, you should be able to force a view to load using code in VC1 like:
At that point the view and subviews for VC2 should be initialized and your references should be valid.