xcode 4.2 ios 5 复制故事板的内容
原始问题:
这是我的第一篇文章。我正在尝试通过按照cs193p(在线)学习ios编程。我被作业 3 困住了,因为一件非常(看似)简单的事情。我已经对它进行了一些谷歌搜索。
我不知道如何将我的视图从作业 2(这是一个故事板)复制到我的新 xcode 项目。
我创建了一个新的主详细信息应用程序(称为 Calculator3),也从其中复制了作业 2 (Calculator2) 中的故事板。但是,我不可能获取该故事板的内容并将它们放入新生成的故事板中。
那么是否可以将一个故事板的内容复制到另一个故事板中呢?如果没有,那么我该怎么做?
Original Question:
This is my first post ever. I'm trying to learn ios programming by following cs193p (online). I got stuck on assignment 3 with a very (seemingly) simple thing. I did a few google searches on it already.
I don't know how to copy my view from assignment 2 (which is a storyboard) to my new xcode project.
I created a new master detail application (called it Calculator3), copied the storyboard from assignment 2 (Calculator2) in there as well. However, it's not possible for me to get the contents of that storyboard and put them in the new generated storyboard.
So is it possible to copy the contents of one storyboard into another? If not, then how do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
感谢 LU RD,我在这里发布了我的答案,而不是在我的第一篇文章中使用编辑。
答:
我的一个朋友解决了这个问题。
我一直出错的原因是因为我执行了 cmd/apple A + cmd/apple C。我不想单击视图顶部,而是想复制然后执行 cmd/apple C。之后,粘贴它在情节提要中使用 cmd/apple V 。
我注意到它只在以下情况下真正有效(我认为它在更多情况下有效)。
Thanks to LU RD I post my answer here, instead of using an edit in my first post.
Answer:
A friend of mine solved it.
The reason why I got this wrong the whole time was because I did cmd/apple A + cmd/apple C. Instead of clicking at the top of the view I wanted to copy and then do cmd/apple C. After that, paste it with cmd/apple V in the storyboard you want to.
I noticed it only really works in the following situation (I thought it worked in more situations).
将旧故事板从源项目引入新目标项目作为临时故事板工作。 :)
(我在源项目的 en.lproj 文件夹中找到了它)您也可以复制 &通过选择视图下的灰色条来粘贴所有视图控制器组件。
然后删除临时故事板并继续粘贴一个。
Bringing the old storyboard from source project into your new target project as a temp storyboard works. :)
(I've found it in en.lproj folder from source project) Also you can copy & paste all view controller component by selecting gray bar under your view.
Then remove temp storyboard and continue with pasted one.
您可以通过拖放故事板将故事板复制到另一个项目。确保勾选“将项目复制到目标组文件夹”框。
当然,您的所有引用都会损坏并且必须重建,但是布局和转场都会在那里。
You can copy a storyboard to another project by drag and dropping the story board. Make sure to tick the box "Copy items into destination groups folder".
Of course all of your references will break and have to be rebuild, but the layout and segues will all be there.