简体   繁体   中英

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.


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.

I open the project in my PC, and I can see the AFNetworking directory, but it is an empty directory.

在此输入图像描述

so, my question is:

How can Xcode know there should have so many files under AFNetworking directory? 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.

How can Xcode know there should have so many files under AFNetworking directory? 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 . And then go to your project folder and drag the whole folder to your Xcode to re-import it.

For the second question,

在此输入图像描述

Xcode has a project file ( $PROJECT_NAME.xcodeproj ) that stores this information.

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.

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. You might though still have a backup of those files in Time Machine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM