简体   繁体   English

xcode:连接主故事板时出现问题

[英]xcode: Problems connecting main storyboard

I am following the tutorial here . 我在这里关注教程。 I just created my first storyboard and tried to set it as the main storyboard. 我刚刚创建了我的第一个情节提要,并尝试将其设置为主讲情提要。 After following the tutorial I clicked the run button and the simulator doesn't render any of the changes ive created. 按照本教程进行操作后,我单击了“运行”按钮,并且模拟器未呈现ive创建的任何更改。

I have a screen shot of my xcode project here(not sure how else to display it): https://app.box.com/s/okw7jlzq5zmcetd5cehu 我在这里有我的xcode项目的屏幕截图(不确定如何显示它): https : //app.box.com/s/okw7jlzq5zmcetd5cehu

What am I doing wrong? 我究竟做错了什么?

Here is another screenshot of the storyboard itself: https://app.box.com/s/jt6i0an3maowwvgsamk7 这是情节提要本身的另一个屏幕截图: https : //app.box.com/s/jt6i0an3maowwvgsamk7

在要加载的视图控制器的“是初始视图控制器”框中打勾。

I think your problem is the code in the app delegate. 我认为您的问题是应用程序委托中的代码。 When you use a storyboard, you don't need anything in there except "return YES". 使用情节提要时,除了“返回YES”外,您不需要任何其他内容。 The storyboard creates the window, so the code you have in there is making another window, not the one that your storyboard controller is a subview of. 故事板将创建一个窗口,因此其中的代码将创建另一个窗口,而不是故事板控制器作为其子视图的窗口。

Using this tutorial might teach you some things about the structure of an iOS app, but if you just want to make an app with a storyboard, you should start with the "single view" template instead of the "empty" one. 使用本教程可能会教给您一些有关iOS应用程序结构的知识,但是,如果您只想使用情节提要制作一个应用程序,则应从“单视图”模板开始,而不是“空”模板。 It will give you a storyboard and an initial controller. 它将为您提供一个故事板和一个初始控制器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM