Search code examples
objective-ccocoa-touchiosxibuiwindow

Battling with Xcode not displaying my UIWindow


See edit at the end of the question

I'm trying to get a simple iPhone app up and running and failing miserably :(

I have a very simple set up. I have an app delegate, a view controller, and an xib file containing a UIWindow with a UIImageView and three UIButtons on it. The problem is that when I start my app, the UIWindow never gets displayed.

I'm sure I'm just missing some sort of connection in Interface Builder (I'm running XCode 4, by the way). I'm just completely lost as to what might be causing the problem.

I appreciate that this explanation is not great, so if anyone has any pertinent questions please feel free to ask them!

Edit: Ok, I can re-create my problem exactly. If I create a "View based" application, then add a button (tried a slider too) to the created window, when I compile and run, the button does not show up. What gives?


Solution

  • Are you adding controls to the window nib or the view controller's nib?

    Add your controls to the view controller nib.