如何在xcode中快速添加回丢失的文件 [英] How to quickly add back missing file in xcode

查看:26
本文介绍了如何在xcode中快速添加回丢失的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 xcode 中压缩了我的项目文件夹并将其移动到一台新计算机.当我打开项目时,它缺少文件(文件显示为红色).

I zipped up my project folder in xcode and moved it to a new computer. When I open up the project it has missing files (file appears red).

如何将所有这些文件添加回来或重新链接它们.好像有 20 多个文件?

How can I add all these files back or re-link them. It is like 20+ files?

xcode 为什么不存储相对路径?

Why didnt xcode store the relative path?

推荐答案

当您将项目从一个环境复制/移动到另一个环境时,Xcode 可能不会更新项目某些文件的位置.我发现的最简单的方法是这样的:

Xcode may not update location for some files of your project when you copy/move it from one environment to another. The easiest way I found is something like this:

1-像这样选择您的文件,如果它们在不同的组中,则分别在每个组上重复流程:

1-Select your files like this, if they are in different groups, then repeat the flow on each group separately:

2- 显示文件检查器:

2- Show the file inspector:

3- 你可能会注意到 Xcode 有一个绝对路径,这没什么用,所以点击 Multiple Values 附近的小图标.导航到您在查找器中存储所选文件的文件夹,然后单击选择".

3- You may notice Xcode has an absolute path for them, which is something not useful, so click on the little icon near Multiple Values. navigate to the folder where your selected files are stored in the finder and click "Choose".

另外,不要忘记将 Location 更改为 Relative to Project.现在你会得到这样的东西:

Also, don't forget to change the Location to Relative to Project. Now you will get something like this:

这篇关于如何在xcode中快速添加回丢失的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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