4

I deleted the universityPicker.xib accidentally and then made a new one with the same name but no connection could be done. The file crashes and gives this message

reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "universityPicker" nib but the view outlet was not set."

How I can fix it?

JaNa Saadeddin
  • 135
  • 1
  • 2
  • 7

2 Answers2

23
  • Open the universityPicker.XIB file
    • Click on file's owner icon on the left bar
    • Click on the third tab in the right-hand sidebar
    • Under "Custom Class" at the top, make sure Class is the name of the ViewController that should correspond to this view. If not, enter it
    • In the right-hand sidebar, click on the last tab
    • You should see "outlets" with "view" under it. Drag the circle next to it over to the "view" icon on the left bar
    • Save the xib and re-run
Ali Abbas
  • 4,247
  • 1
  • 22
  • 40
  • 1
    EXTREMELY HELPFUL!! :-) I was testing the possibility of putting all my views into a Presentation folder. I received this error and knew that all my subviews were hooked up. The last 3 bullet of your answer was to magic trick. Thank you. – Patricia Feb 19 '14 at 16:14
0

In the Interface Builder you should connect the View to the File's Owner.

Templar
  • 1,694
  • 1
  • 14
  • 32