简体   繁体   English

为什么我的Xcode知道项目的目录应该有文件?

[英]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 . 您可以单击Xco​​de中的红色文件夹,然后按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.

相关问题 我应该在xcode项目中将文件添加到哪些目标 - What targets should I be adding my files to in my xcode project Xcode 9(测试版3)/ iOS:将文件添加到项目中-如何使其将文件复制到项目目录中 - Xcode 9 (beta 3) / iOS: Adding files to a project - how to make it copy the files into the project's directory 是否想使用目标c在我的Xcode项目中是否存在目录? - Would like to know whether a directory exist or not inside my Xcode project using objective c? 为什么不能从XCode项目中删除文件? - Why can't I delete files from my XCode project? 为什么不将文件显示在添加到Xcode项目中的子模块中? - Why not appear the files in submodules added into my Xcode project? 为什么我的Xcode项目仅在工作空间中时才编译? - Why does my Xcode project compile only when it's in a workspace? 为什么我从xcode项目中删除的Bundle.Main.localizations中有本地化? - Why do I have a localization in the Bundle.Main.localizations that I have deleted from my xcode project? 在上传到github之前,我应该隐藏iOS Xcode项目中的哪些文件? - Which files in my iOS Xcode project should I hide before uploading to github? AppDelegate.m和ViewController.h文件在我的xcode项目导航器中变成红色 - AppDelegate.m and ViewController.h files have turned red in my xcode project navigator 为什么我的xcode项目建立在模拟器上而不是xcode项目中的设备? - Why does my xcode project build on simulator but not device in xcode project?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM