Search code examples
iosinterface-builderoutlet

Exception when trying to load view on iPad: "loaded the nib but the view outlet was not set", how do I add that outlet?


I get this exception:

Objective-C exception thrown.
Name: NSInternalconsistencyException
Reason: - [UIViewController_loadViewFromNibNamed:bundle:] loaded the "TestRunnerViewController_iPad" nib but the view outlet was not set.

Sure enough, if I inspect the iPhone view I created first, I can see this:

view outlet in working view

But, in the one that crashes, an iPad view for the same controller that I added manually, this outlet does not exist, and I can't figure out how to add it. I've looked under File's Owner, same place where I found the outlet on the working view, but I can't figure out where to drag the "new referencing outlet" connector, it doesn't seem to link up with anything:

outlets for crashing view

So, the question is simple. How do I add the required view outlet to my new view?

Note that I'm using MonoTouch/MonoDevelop, but since this is a question related to Xcode Interface Builder 4, I doubt that is relevant.


Solution

  • Have you set the class type for File's Owner?