I had the same problem. If you're building a window-based application "from scratch" as I was, you'll need to do the following: (note, these are steps for Xcode 4.2.)
0. Make sure your application delegate conforms to the UIApplicationDelegate protocol.
For example, suppose our delegate is called MyAppDelegate. In MyAppDelegate.h, we should have something like this:
@interface MyAppDelegate :
NSObject <UIApplicationDelegate>
1. Specify the application delegate in main.m
For example,
#import "MyAppDelegate.h"
int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv,
nil, NSStringFromClass([MyAppDelegate class]));
}
}
2. Create a main window interface file.
To do this, right-click on your project and choose New File. From there, choose Window from the iOS -> User Interface section.
After adding the file to your project, go to the project's summary (left-click on the project; click summary.) Under iPhone/iPod Deployment Info (and the corresponding iPad section if you like) and select your new interface file in the "Main Interface" combo box.
3. Hook it all up in the interface editor
Select your interface file in the files list to bring up the interface editor.
Make sure the Utilities pane is open.
Add a new Object by dragging an Object from the Objects list in the Utilities pane to the space above of below your Window object. Select the object. Click on the Identity inspector in the Utilities pane. Change the Class to the application's delegate (MyAppDelegate, in this example.)
Bring up the connections inspector for MyAppDelegate. Connect the window outlet to the Window that already exists in the interface file.
Click on File's Owner on the left, and then click on the Identity inspector in the Utilities pane. Change the Class to UIApplication
Bring up the connections inspector for File's Owner. Connect the delegate outlet to the MyAppDelegate object.
4. Finally, and very importantly, click on the Window object in the interface file. Open the Attributes inspector. Make sure "Visible at Launch" is checked.
That's all I had to do to get it working for me. Good luck!