Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Loaded the nib file but the view outlet was not set

Tags:

xcode

ios

iphone

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?

like image 455
JaNa Saadeddin Avatar asked Nov 29 '22 16:11

JaNa Saadeddin


1 Answers

  • 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
like image 121
Ali Abbas Avatar answered Dec 01 '22 07:12

Ali Abbas