Xcode:项目导航器,黄色文件夹和蓝色文件夹的区别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13346247/
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-15 02:04:16  来源:igfitidea点击:

Xcode: project navigator, difference between Yellow folder and blue folder

iosxcode

提问by Fry

I want to know the difference between a blue folder and a yellow folder in Xcode.

我想知道 Xcode 中蓝色文件夹和黄色文件夹之间的区别。

enter image description here

在此处输入图片说明

I found thisbut doesn't clarify my doubts!

我发现了这个,但没有澄清我的疑虑!

回答by JiaYow

Yellow folders are "Groups", they are not actual folders but references to folders/files. They exist only to organize your project in Xcode. Blue folders are actual folders existent in the file system.

黄色文件夹是“组”,它们不是实际文件夹,而是对文件夹/文件的引用。它们的存在只是为了在 Xcode 中组织您的项目。蓝色文件夹是文件系统中存在的实际文件夹。

Blue folders give you the benefit of not having to "Add File" everytime something new lands in the folder i.e. an image. However, you should still mostly use groups (aka yellow folders) because it gives you more control on what will be bundled with your app (think of hidden files in the folder/versioning files). Also, sometimes blue folders can mess up your file hierarchy in your bundle, ie. causing the splash screen to malfunction. There are only a few cases where you would use blue folders, like a "content" folder, where anything in the folder should be packed with the bundle (as Mark Szymczyk commented, images or videos). If you're not sure, stick with yellow folders.

蓝色文件夹的好处是不必每次在文件夹中有新内容(即图像)时都“添加文件”。但是,您仍然应该主要使用组(又名黄色文件夹),因为它可以让您更好地控制与您的应用程序捆绑在一起的内容(想想文件夹/版本文件中的隐藏文件)。此外,有时蓝色文件夹可能会弄乱捆绑包中的文件层次结构,即。导致启动画面出现故障。只有少数情况下您会使用蓝色文件夹,例如“内容”文件夹,文件夹中的任何内容都应该与捆绑包一起打包(如 Mark Szymczyk 评论的,图像或视频)。如果您不确定,请坚持使用黄色文件夹。

回答by Larme

Yellow folder should be links (group, act as a folder, but if you check in Finder, there are not, like a Playlist in iTunes), and blues ones are ? physical ? (as folder in Finder).

黄色文件夹应该是链接(组,充当文件夹,但是如果您在 Finder 中查看,则没有,就像 iTunes 中的播放列表一样),而蓝调的是 ? 身体的 ?(作为 Finder 中的文件夹)。