I have a NIB that contains a UINavigationController which has a UIViewController. The UIViewController is being loaded externally from another nib. I am unable to set the view property thus I get the error:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "LBRootViewController" nib but the view outlet was not set.'
How can I set my view property correctly?
You have a nib file of
LBRootViewController.xib. Inside that nib is a view controller subclass that has an outlet namedview. That outlet is not set.When your (default name)
MainWindow.xibloads, it instantiates an instance ofLBRootViewControllerbut then finds that the controller has no view outlet meaning it cannot display anything.The nib you need to examine is
LBRootViewController.xiband notMainWindow.xib.If for some reason the
LBRootViewControllerobject inLBRootViewController.xibdoesn’t have a view property, then you have set the object to the wrong class i.e. something other than a UIViewController subclass.