xcode 4.2 ios 5 复制故事板的内容

发布于 2024-12-29 07:37:04 字数 362 浏览 4 评论 0原文

原始问题:

这是我的第一篇文章。我正在尝试通过按照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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷默言语 2025-01-05 07:37:05

感谢 LU RD,我在这里发布了我的答案,而不是在我的第一篇文章中使用编辑。

答:

我的一个朋友解决了这个问题。
我一直出错的原因是因为我执行了 cmd/apple A + cmd/apple C。我不想单击视图顶部,而是想复制然后执行 cmd/apple C。之后,粘贴它在情节提要中使用 cmd/apple V 。

我注意到它只在以下情况下真正有效(我认为它在更多情况下有效)。

  1. 这两个文件应该位于同一个项目中,因此将旧的故事板文件复制到新项目中。
  2. 然后通过“显示助理编辑器”按钮将两个故事板并排显示。
  3. 单击视图的顶部中间并通过 cmd/apple C 进行复制。
  4. 单击其他故事板并通过 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).

  1. The two files should be in the same project, so copy the old storyboard file to your new project.
  2. Then display the two storyboards next to each other via the "show the assistant editor" button.
  3. Click in the top middle of your view and copy via cmd/apple C.
  4. Click on your other storyboard and paste it via cmd/Apple V.
空名 2025-01-05 07:37:05

将旧故事板从源项目引入新目标项目作为临时故事板工作。 :)

(我在源项目的 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.

夏九 2025-01-05 07:37:05

您可以通过拖放故事板将故事板复制到另一个项目。确保勾选“将项目复制到目标组文件夹”框。

当然,您的所有引用都会损坏并且必须重建,但是布局和转场都会在那里。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文