Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to load nib file: MainWindowController.xib, exiting

I just created my first Mac Application but the program keeps crashing with this message:

Unable to load nib file: MainWindowController.xib, exiting

All I did was delete MainMenu.xib and created MainWindowController.xib and added it as the MainInterface.

enter image description here

like image 316
Abdullah Shafique Avatar asked Nov 25 '13 20:11

Abdullah Shafique


1 Answers

This error is caused by the nib/xib missing at runtime when NSApplication tries to load what it is told is the main interface nib. In most cases it stems from accidentally removing the nib from the "Copy Bundle Resources" build phase for your application target. For other (non main nibs) it can also be caused by typos when typing the nib name.

In this specific case, however, I have determined that selecting the "main interface" from the dropdown menu in the target properties section is bugged. You have to delete the ".xib" extension from it for it to work correctly; so manually type MainWindowController instead of the MainWindowController.xib that you selected.

With the ".xib" extension in the "Main Interface" box, NSApplication will erroneously attempt to load MainWindowController.xib.xib

like image 127
Brad Allred Avatar answered Oct 22 '22 16:10

Brad Allred