3

I'm getting this error:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "BYZ-38-t0r-view-8bC-Xf-vdC" nib but the view outlet was not set.'

enter image description here

Here's my select outlets bar:

enter image description here

How can I solve this?

I've tried the solutions suggested on this question, but none have worked for me so far.

fi12
  • 495
  • 11
  • 30
  • Click on "View" and goto connection and see if the view has connection or not. If not, then connect it to File Owner. – GeneCode Jul 27 '17 at 05:45
  • @GeneCode it does have a view connection to File's Owner. do you know how to solve this problem? – fi12 Jul 30 '17 at 13:26
  • I'm not entirely sure why this was closed as a duplicate; I've tried what was suggested in the other question, but none of those solutions have worked for me. – fi12 Jul 30 '17 at 13:37

1 Answers1

6

You may have changed the content of you view. And because of that the nib has lost its view element. To fix this error open your nib and select the File’s Owner. In the right-hand sidebar, click on the last tab--the one that looks like a circle with an arrow in it. See what you have connected to your controls in the storyboard. Make sure the view has connected to the view on the left bar. You can find more answers close to your question here. You can post some images of your select outlets bar if the error still exists.

Ax1le
  • 6,563
  • 2
  • 14
  • 61
  • I don't have any nibs in my project because I'm using storyboards. What should I open instead of my nib? My view? – fi12 Jul 28 '17 at 03:02
  • I've updated my question with a picture of my select outlets bar. – fi12 Jul 28 '17 at 03:03
  • It looks something wrong with the connection called "big view". try to delete it and reset the connection to the view. Besides which I said is the last connection. – Ax1le Jul 28 '17 at 05:23
  • It's no need to set the root view of the ViewController to "big view". you can just use it as "self.view" in the VC. – Ax1le Jul 28 '17 at 05:36
  • Okay, I've removed the Big View connection, but what do you mean by using self.view in the VC? – fi12 Jul 29 '17 at 16:12
  • Do you know how to solve this problem? – fi12 Jul 30 '17 at 13:21
  • Can you run the project after you removing the connection called "bigView"? From your image I also see the connection with the gray color. Try to remove the last one. – Ax1le Jul 31 '17 at 01:48
  • I'm not sure how to remove that. The x button doesn't work for that one because it's faded. – fi12 Jul 31 '17 at 01:49
  • Remove the last one in your above image. – Ax1le Jul 31 '17 at 01:50
  • Okay, I'll try that. – fi12 Jul 31 '17 at 01:51
  • That didn't work. Here is an updated screenshot of what my select outlets bar looks like: http://imgur.com/a/ZdqYW – fi12 Jul 31 '17 at 02:12
  • The basic view has two connections. Try to remove one, and run the project. – Ax1le Jul 31 '17 at 02:18
  • I simply had to rename the subview to something different and follow what you told me in the previous comment and the problem resolved itself. – fi12 Aug 01 '17 at 18:09
  • Have a happy day :) – Ax1le Aug 02 '17 at 01:17