如何将 XIB 复制到另一个项目?
简单的。我在 Xcode 中有两个项目。在其中一个项目中,我制作了一个 .xib 文件,我想将其复制到另一个项目,以便节省一些重做的时间。
我无法将其拖动到其他项目,也无法通过命令复制/粘贴,也无法通过编辑菜单复制/粘贴。
有什么建议吗?
Simple. I have two projects in Xcode. In one of them I made a .xib file and I want to copy it to another project, so as to save some time redoing it.
I can't drag it to the other project, nor do copy/paste by command, nor copy/paste by the Edit menu.
Any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
以下是我如何使用 XCode 10.2.1 完成此操作
无需重新连接插座。
Here is how I managed to do this with XCode 10.2.1
There is no need to reconnect the outlets.
进入finder,找到.xib文件并将其复制到第二个项目的目录中。然后使用添加现有文件将其添加到第二个项目中。
Go into finder, find the .xib file and copy it to the directory of the second project. Then uses add existing files to add it to the second project.
只需从一个项目窗口拖放到另一个项目窗口即可。
确保选中“将项目复制到目标文件夹”
如果您有多个目标,请确保在添加目标时选中适当的目标。
您可能必须重新连接所有插座,如果由于某种原因崩溃,则意味着存在代码中不可用的已连接插座/操作。
Just drag and drop from one project window to the other.
Make sure that you check the "Copy items to the destination folder"
If you have more than one targets make sure that you check the appropriate target when you add it.
You probably have to reconnect all of your outlets, and if it crashes for some reason it means that there are connected outlets/actions which are not available in your code.