Xcode:如何将文件添加到文件夹引用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5171597/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 20:21:43  来源:igfitidea点击:

Xcode: How to add a file to a folder reference

xcode

提问by Joseph Tura

I want to add a file to an existing folder in Xcode. I have a folder in the file system that I have added to my resources. Now when I add a file to that folder, and try to drag and drop that file onto the folder reference in Xcode, I am out of luck.

我想将文件添加到 Xcode 中的现有文件夹。我在文件系统中有一个文件夹,已添加到我的资源中。现在,当我向该文件夹添加一个文件,并尝试将该文件拖放到 Xcode 中的文件夹引用时,我很不走运。

Even if I delete the reference and drag the whole folder over again, it does not work, as it imports all files that were in the folder when I originally imported it, but not the new ones.

即使我删除引用并再次拖动整个文件夹,它也不起作用,因为它会导入我最初导入时文件夹中的所有文件,但不会导入新文件。

Any ideas on that one?

对那个有什么想法吗?

screenshot

截屏

回答by horseshoe7

Drag it into that folder in Finder, then right click that blue folder in Xcode and then "touch" it. Or collapse and expand that folder icon (is like touching it).

将它拖到 Finder 中的那个文件夹中,然后在 Xcode 中右键单击那个蓝色文件夹,然后“触摸”它。或者折叠并展开该文件夹图标(就像触摸它一样)。