I’m using Storyboard first time, and I’ve created UITabBarController application. I’ve got 4 UINavigationControllers in UITabBarController. At the start only first UINavigationController with root UIViewController initializes, but other 3 initizlize only when I select them. How to init them all? I need instance each of them at the start.
For example I need to set data from first UIViewController to the fourth, but to do that now, I need to select it first. I’ve put breakpoints in each UIViewContoller in the viewDidLoad method, and breakpoint enables only when I select this UIViewController.
Is there way to init them all?
Im am pretty sure that the
UINavigationControllerstogether with their rootUIViewControllerare instantiated as soon as you load theUITabBarControllerfrom the storyboard. Therefore you should be able to send messages to them.But the
viewof aUIViewControlleris loaded only when needed, therefore theviewDidLoadmethod is only hit when you select that tab.The
viewof a view controller can also be unloaded at runtime, when the view is not visible and memory is low.