为什么我的 Xcode 项目中有一些蓝色文件夹? [英] Why are there some blue folders in my Xcode project?

查看:35
本文介绍了为什么我的 Xcode 项目中有一些蓝色文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从 Github 导入我的项目时,我有两个文件夹在 Xcode 中显示为蓝色,但所有其他文件夹都是黄色的.怎么回事?

When I import my project from Github, I have two folders which appear in Xcode with a blue color, but all the other folders are yellow. What's going on?

推荐答案

蓝色用于表示文件夹引用".

Blue is used to represent a "Folder Reference".

对这些是什么以及何时使用它们的清晰描述来自 http://struct.ca/2010/xcode-folder-references/

A clear description of what these are and when to use them comes from http://struct.ca/2010/xcode-folder-references/

Xcode 中有两种类型的文件夹:组和文件夹引用.您可以使用组来组织项目中的文件而不影响它们在实际文件系统上的结构.这对代码来说很棒,因为你只会在 Xcode 中处理你的代码.在另一方面,组对于资源文件不是很好.

There are two types of folders in Xcode: groups and folder references. You can use groups to organize files in your project without affecting their structure on the actual file system. This is great for code, because you’re only going to be working with your code in Xcode. On the other hand, groups aren’t very good for resource files.

在任何相当复杂的项目中,您通常会处理数十个(如果不是数百个)资产文件,这些资产将需要由您或您从 Xcode 外部修改和操作一个设计师.将所有资源文件放在一个平面文件夹中是一种灾难的秘诀.这就是文件夹引用的用武之地.它们允许您将文件组织到文件系统上的文件夹中在 Xcode 中保持相同的文件夹结构.

On any reasonably complicated project, you’ll usually be dealing with dozens – if not hundreds – of asset files, and those assets will need to be modified and manipulated from outside of Xcode, either by you or a designer. Putting all of your resource files in one flat folder is a recipe for disaster. This is where folder references come in. They allow you to organize your files into folders on your file system and keep that same folder structure in Xcode.

这篇关于为什么我的 Xcode 项目中有一些蓝色文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆