2
votes

I am using Storyboard to navigate through my View Controllers. I have my Root View Controller called (RootVC) which I've hooked up to the next view controller (called SecondVC) with a 'push' segue. I have a button in RootVC that when pressed calls pushViewController. When I run this, I end up seeing the following error:

* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SecondVC" nib but the view outlet was not set.'

I've looked around and seen a lot of people suggesting that the UIView is not properly hooked up in the xib. I'm using Storyboard so it's a little different, but I can still see that my SecondVC's view outlet is connected to the UIView that belongs to it. By the looks of it, Storyboard makes this association by default.

Anyone have any ideas of what could be going wrong? If a screenshot of my Storyboard is needed I can provide that.

Thanks in advance.

4

4 Answers

4
votes

I had the same issue, make sure you do not have

@synthesize view; 

in you viewcontroller .m file.

3
votes

In your storyboard, right click on the File's owner and select your view as it's view outlet.

1
votes

The name 'View' for the view is a reserved name. When you want to synthesize a view named 'View' this error will occur.

Solution is to rename the view to your own name.

0
votes

I don't know just giving ideas

You probably already seen this 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the GameView nib but the view outlet was not set

It has to do with a connection. The class name of the View controller element in interface builder should match up with the class name (case sensitive) with the appropriate class that derives from UIViewController. You should not need to create an IBOutlet of named view. Doing a clean might help. It could be a typo in your code too.