将故事板添加到现有项目 [英] Adding storyboard to existing project
本文介绍了将故事板添加到现有项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个没有故事板支持的项目,但后来我添加了一个故事板。故事板工作得很好,我在模拟器中加载应用程序时看到它的内容。
I have created a project without support of storyboards, but later I have added a storyboard. Storyboard work well and i see it's contents when loading app in emulator.
然后我创建了一个视图控制器(UIViewController),我的问题是我无法绑定任何控件从故事板到我的控制器。
Then I created a view controller (UIViewController), and my problem is I can't bind any control from storyboard to my controller.
所以我的问题是如何将我的控制器与故事板连接。
So my question is how to connect my controller with storyboard.
推荐答案
这些确切的步骤(我正在使用XCode 4.5和iOS 6.0):
Those exact steps (I am using XCode 4.5 and iOS 6.0 ):
- 向项目中添加新的故事板通过File-> New-> File ...-> Userinterface-> storyboard
- 转到项目摘要并选择MainStoryboard并选择刚刚创建的故事板名称。
- 从方法didFinishLaunchingWithOptions中的AppDelegate.m文件中,注释除了返回YES的最后一个语句之外的所有内容。
这就是全部。现在,您应该在启动项目时看到初始视图。
That is all. Now you should see your Initial view as you launch the project.
这篇关于将故事板添加到现有项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文