story board是xcode4.2新增的一个特性,它将原有工程中的所有xib文件集成在一起,用拖拽的方式建立2个viewController之间的跳转关系,使得整个程序的UI跳转逻辑清楚明了。使用storyboard后,界面相关的代码编写将更少。
简单说一个storyboard是个什么东西。storyboard引入了2个概念:
scene: 一个场景, 由一个viewController和相关的xib表示
segue: ['seiɡwei] n. 继续,持续。用于连接scenes,segue有多种类型,包括:
Push, Modal, Popover and more
segue 也负责传递数据和返回数据。
整个程序的界面转换就是在scene之间切换。界面跳转关系,比如按哪个键跳到哪个界面,由segue来描述。segue也可以带数据,以便做数据传递。据说苹果的这种设计方案是抄的 Adobe的Flash,具体不得而知。
story board因为刚刚在WWDC2011大会上介绍给开发者。所以相关资源和教程非常少。这里有一篇入门级教程,可以自己尝试做一个demo试试: http://kurrytran.blogspot.com/2011/07/simple-ios-5-tutorial-using-storyboard.html 。
另外,WWDC2011的 Session 300 - Developer Tools Kickoff , Session 309 - Introducing Interface Builder Storyboarding ,都有对这个工具的较详细的介绍和Demo。可以在itunes上免费下载或者去youtube直接看。
另外,我在使用时,常常出现程序异常退出,错误信息是:
StoryboardApp[8593:207] Failed to instantiate the default view controller for UIMainStoryboardFile 'MainStoryboard' - perhaps the designated entry point is not set?
简单说一个storyboard是个什么东西。storyboard引入了2个概念:
scene: 一个场景, 由一个viewController和相关的xib表示
segue: ['seiɡwei] n. 继续,持续。用于连接scenes,segue有多种类型,包括:
Push, Modal, Popover and more
segue 也负责传递数据和返回数据。
整个程序的界面转换就是在scene之间切换。界面跳转关系,比如按哪个键跳到哪个界面,由segue来描述。segue也可以带数据,以便做数据传递。据说苹果的这种设计方案是抄的 Adobe的Flash,具体不得而知。
story board因为刚刚在WWDC2011大会上介绍给开发者。所以相关资源和教程非常少。这里有一篇入门级教程,可以自己尝试做一个demo试试: http://kurrytran.blogspot.com/2011/07/simple-ios-5-tutorial-using-storyboard.html 。
另外,WWDC2011的 Session 300 - Developer Tools Kickoff , Session 309 - Introducing Interface Builder Storyboarding ,都有对这个工具的较详细的介绍和Demo。可以在itunes上免费下载或者去youtube直接看。
另外,我在使用时,常常出现程序异常退出,错误信息是:
StoryboardApp[8593:207] Failed to instantiate the default view controller for UIMainStoryboardFile 'MainStoryboard' - perhaps the designated entry point is not set?
之前一直没有找到原因,网上资料也没有搜到,今天终于发现,原来有一个view controller是作为story board的第一个界面,需要勾选上 Initial Scene。如下图: