I created UITabBarController with each tab contain UINavigationController and set rootviewcontroller in this UINavigationController, all of this is done in interface builder. In viewDidLoad I try to get frame size from view, but when I reference view it return null. Have anyone experienced this before.
All IBoutlet are properly connected.
viewDidLoadreturning a nil view if the view is connected in your.xibcould mean:For programmatic initialisation (custom controllers):
initWithNibName:bundle:on the view controller class altogether (you may have calledinitor something instead).loadViewmethod in your view controller class, but it doesn’t set theview.For all controllers:
nibNameparameter was not properly specified when initialising the view (the nib could not be found or one without a view was found.. though this should also throw an exception).view(the app would likely have been terminated by that point though).I’d recommend you try doing frame size calculations in
viewWillAppear:instead and see if theviewis stillnilat that point.