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

I am working on the Big Nerd Ranch Guide (2nd Ed) for programming iOS using Xcode 4.2.

For the very first project, I am invited to create a new project, which is a "window application", the description of which reads "This template provides a starting point for any application. It provides only the application delegate and window." The "Window-based Application" option was not available to me in Xcode 4.2, but I saw the possibility of creating a "new empty application" that has the same description ("This template provides a starting point for any application. Application delegate and window")

When I create the project, I should have the MainWindow.xib file, but it does not appear at all in my project? help me please

+7
source share
5 answers

When you create a project, be sure to uncheck the "storyboard" checkbox. Once you uncheck it, you will see xib files.

+11
source

I use the same book, had the same problem, but I decided how to fix it.

  • Create a new xib file with

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

  • click the Window.xib file, then find the object and drag it under the objects → select the third tab on the right → change this class to AppDelegate

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

  • go to AppDelegate.h and place an IBOutlet in front of the UIWindow * window;

go to Window.xib and connect to the Outlets to Window.

Also in the plist file add the line key - the base name of the main file nib type - string value - mainwindow

Hope this helps.

+5
source

You can also create MainWindow.xib afterwards:

File > New > File > 

Must be Window.xib . If not, create an empty .XIB file and drag the window ( UIWindow ) into the "Objects" panel. Copy the connections as they appear in the book.

Hope this helps.

PS .: I recommend not using the beta version to run with iOS

+1
source

If you are creating an empty project and do want to use storyboading, follow these steps:

  • create an empty project
  • add new file (storyboard)
  • Be sure to add the correct entry to the app-info.plist file. (Just create a simple project with a storyboard and look there for the key in the application).
  • drop the view controller on the board and release.

Similarly, you have a nice clean project using storyboards.

+1
source

Read it on the official forum in the Book. BNR has published a project that you can use as your default project for all chapters in this book. They created a small project that looks as if you created an empty project with an Xcode version before iOS5 was released.

http://forums.bignerdranch.com/viewtopic.php?f=74&t=1817

considers

Thomas

+1
source

All Articles