0
votes

Created a simple navigation controller based application. Application delegate class has Outlets for window and navcontroller.

MainWindow.xib has a Window and a navigation controller. Files owner is UIApplication and I have an Application Delegate (class is of course my App Delegate) with an outlet to the window and the nav controller, plus a delegate connected to the Files Owner.

In applicationDidFinishLaunching I am trying to set the window's rootViewController to the navigationController but the Outlet for the navigationController is nil and (of course) the application comes up with a blank window...and the error "Application windows are expected to have a root view controller at the end of application launch".

What am I missing here?

1

1 Answers

1
votes

Does the Navigation controller itself have a root view controller? A navigation controller cannot exist solely on its own. It is a wrapper view around other ViewControllers. There should be a setting in the view controller properties tab in Interface Builder that will let you set either another view controller in the xib as its root, or load it from a different xib.