[英]Why my Xcode know the project's directory should have the files?
When I reading a GitHub project, there have a type of this below, when I click it, it will go to the AFNetworking open source project. 当我阅读GitHub项目时,下面有一种类型,当我点击它时,它将转到AFNetworking开源项目。
after I download this project, when I use Xcode open it, it shows the red directory and red files, it represent them do not exist. 下载这个项目后,当我使用Xcode打开它时,它会显示红色目录和红色文件,它代表它们不存在。
I open the project in my PC, and I can see the AFNetworking
directory, but it is an empty directory. 我在我的电脑上打开项目,我可以看到AFNetworking
目录,但它是一个空目录。
so, my question is: 所以,我的问题是:
How can Xcode know there should have so many files under AFNetworking
directory? Xcode如何知道AFNetworking
目录下应该有这么多文件? and how to restore the files to the directory? 以及如何将文件还原到目录?
What's this for? 这是用来干嘛的? is it just a link? 它只是一个链接? not a directory which contains codes? 不是包含代码的目录?
It means that Xcode couldn't find the folder and the files. 这意味着Xcode找不到文件夹和文件。
How can Xcode know there should have so many files under AFNetworking directory? Xcode如何知道AFNetworking目录下应该有这么多文件? and how to restore the files to the directory? 以及如何将文件还原到目录?
I'm not sure with this but I guess you can try the folder button in the screenshot below to locate your files/folders. 我不确定这个,但我想你可以尝试下面的截图中的文件夹按钮来找到你的文件/文件夹。
OR 要么
You can click on the red folder in your Xcode and just press DELETE
. 您可以单击Xcode中的红色文件夹,然后按DELETE
。 And then go to your project folder and drag the whole folder to your Xcode to re-import it. 然后转到项目文件夹并将整个文件夹拖到Xcode中以重新导入它。
For the second question, 对于第二个问题,
Xcode has a project file ( $PROJECT_NAME.xcodeproj
) that stores this information. Xcode有一个存储此信息的项目文件( $PROJECT_NAME.xcodeproj
)。
The yellow folders in the project navigator are called groups . 项目导航器中的黄色文件夹称为组 。 Those are not folders on the file system, but they point to a folder on the file system. 这些不是文件系统上的文件夹,但它们指向文件系统上的文件夹。 Each group contains files and further groups. 每个组包含文件和其他组。 A file in such a group is also a reference to a file on the file system. 此类组中的文件也是对文件系统上的文件的引用。
If you delete a folder or file that is referenced in the project navigator in Xcode, it shows that item in red as it can't find the folder or file that it points to. 如果删除Xcode中项目导航器中引用的文件夹或文件,则会显示该项为红色,因为它找不到它指向的文件夹或文件。
It's important to understand that the hierarchy in the project navigator does not correspond to the hierarchy on the file system. 重要的是要了解项目导航器中的层次结构与文件系统上的层次结构不对应。
Unless you've previously checked in those files to a VCS such as Git, there is no way to restore those files. 除非您之前已将这些文件签入Git等VCS,否则无法恢复这些文件。 You might though still have a backup of those files in Time Machine. 您可能仍然在Time Machine中备份这些文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.