与 Xcode 斗争不显示我的 UIWindow
请参阅问题末尾的编辑
我正在尝试启动并运行一个简单的 iPhone 应用程序,但惨败:(
我的设置非常简单。我有一个应用程序委托、一个视图控制器和一个 xib 文件,其中包含一个 UIWindow
以及一个 UIImageView
和三个 UIButton
问题在于。当我启动我的应用程序时, UIWindow
永远不会显示。
我确定我只是在 Interface Builder 中缺少某种连接(顺便说一句,我正在运行 XCode 4)。 我知道这个解释不太好,
所以如果有人有任何相关问题,请随时询问他们
编辑:好的,我可以准确地重新创建我的问题。我创建一个“基于视图”的应用程序,然后添加一个按钮(也尝试了滑块)到创建的窗口,当我编译并运行时,按钮不显示是什么原因?
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 UIButton
s 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您是否向窗口笔尖或视图控制器的笔尖添加控件?
将控件添加到视图控制器笔尖。
Are you adding controls to the window nib or the view controller's nib?
Add your controls to the view controller nib.
XCode 默认项目无需您执行任何操作即可编译。如果您不知道从哪里开始,并且您的应用程序实际上很简单,请从头开始,逐步添加单个功能。这样,它对您来说会更有用,对我们来说会更简单:)
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 :)