从故事板中提取nibs / xib(iOS) [英] Extracting nibs/xibs from storyboards (iOS)

查看:195
本文介绍了从故事板中提取nibs / xib(iOS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个带有故事板的简单项目,现在意识到他们不支持iOS 4.x,并且我希望使用这些设备的用户能够下载我的应用程序。该应用程序只是一个翻转视图控制器,并且非常简单,但如果有一种方法可以从故事板中提取XIB,我宁愿这样做而不是重新创建它。

I have created a simple project with a storyboard, and now realize that they don't support iOS 4.x and that I would like users with these devices to be able to download my app. The app is just a flipside view controller, and is fairly simple but if there's a way to just extract the XIBs from the storyboard I'd much prefer to do that than recreate it.

tl; dr:从.storyboard中获取.xibs?

tl;dr: getting .xibs out of a .storyboard?

推荐答案

我发现最简单的方法是复制并将这些项目从故事板中粘贴出来,一次一个视图,并为每个视图重新创建视图控制器。

I found that the simplest method was to copy and paste the items out of the storyboard, one view at a time, and recreate the view controllers for each one.

但是,对于任何执行此操作的人,请注意除了所有其他XIB之外,还必须为MainWindow创建一个xib ,并相应地进行连接,包括设置窗口和应用委托。故事板为您处理所有这些,因此当您尝试避免它们时,您需要进行大量手动设置,以便从get-go句柄中为您创建非故事板项目。不要做我做的事情,并尝试让你的根控制器成为你的主视图控制器,因为它会说明UIApplication如何不符合你的XIB的各个属性的键值。

However, for anybody who does this, note that you have to make a xib for MainWindow in addition to all of your other XIBs, and hook it up accordingly, including setting up the window and app delegate. Storyboards handle all of this for you, so when you try to avoid them, you have a lot of manual setting up that creating non-storyboard projects from the get-go handles for you. Don't do what I did, and try to make your root controller your main view controller, because it will go nuts saying things about how UIApplication isn't key-value compliant for individual properties of your XIB.

这篇关于从故事板中提取nibs / xib(iOS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆