Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no .xib file when I create a new "Empty Application" in XCode

I am working through the Big Nerd Ranch Guide (2nd Ed) for iOS Programming using Xcode version 4.2.

For the very first project I'm asked to create a new project which is a "Window-based Application" the description for which reads "This template provides a starting point for any application. It provides just an application delegate and a window". The "Window-based Application" option was not available to me in XCode 4.2 but I did see the option to create a "New Empty Application" which has the same description ("This template provides a starting point for any application. It provides just an application delegate and a window")

When I create the project I'm supposed to have a MainWindow.xib file but that does not show up at all in my project? Help please

like image 429
Ayush Agarwal Avatar asked Sep 05 '11 22:09

Ayush Agarwal


2 Answers

When you create the project, don't forget to uncheck the option "storyboard". Once you uncheck it, you can see the xib files.

like image 56
dreamwitz Avatar answered Oct 22 '22 07:10

dreamwitz


I am using the same book, had the same problem but I figured how to fix it.

  1. Create a new xib file by

right click Quiz folder -> New File -> iOS -> User Interface -> Window -> click Next

  1. click the Window.xib file then find an Object and drag it under Objects -> select the third tab on the right -> change this class to AppDelegate

click File's Owner -> change this class to UIApplication -> click the 6th tab and connect delegate to Window

  1. goto AppDelegate.h and put IBOutlet in front of UIWindow *window;

goto Window.xib again and connect window under Outlets to Window.

Also in plist file add a row key - Main nib file base name type - string value - mainwindow

Hope this helps.

like image 36
Steve Ham Avatar answered Oct 22 '22 07:10

Steve Ham