Battling with Xcode not displaying my UIWindow

只愿长相守 提交于 2019-12-11 12:22:28

问题


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?


回答1:


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

Add your controls to the view controller nib.




回答2:


XCode default projects compile without you have to do anything. If you don't know where to start, and your app is actually simple, start again from the beginning, adding step by step a single functionality. This way it'll more useful for you and simpler for us :)



来源:https://stackoverflow.com/questions/6232284/battling-with-xcode-not-displaying-my-uiwindow

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!