在 Xcode 中创建组与创建文件夹引用 [英] Create groups vs Create folder reference in Xcode

查看:51
本文介绍了在 Xcode 中创建组与创建文件夹引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇使用 Xcode.

I'm curious when using Xcode.

在复制我的项目所需的开源类文件时,我总是需要选择一个选项.

I always need to choose an option when copying the open source class files I need for my project.

选项是创建组"和创建文件夹引用".

The options are "Create groups" and "Create folder references".

我已经阅读了两者之间的区别.

I've read the difference between the two already.

但是完全看不懂.

当我选择了两个选项之一时,我从我的项目中删除了文件,同时删除了开源类文件.

When I chose one of the two options, I deleted the file from my project and the open source class file was deleted at the same time.

我不想要它.

我想一直作为一个独立的文件存在.我应该选择什么?

I want to always exist as an independent file. What should I choose?

推荐答案

任何 Xcode 项目结构组织有两种类型:

There are two types of any Xcode project structure organization:

  • 文件系统项目结构(使用Finder.app检查)
  • IDE 项目结构(可使用 Xcode 导航器区域中的 Project Navigator 检查.)
  • filesystem project structure (inspectable with Finder.app)
  • IDE project structure (inspectable with Project Navigator in Xcode's navigator area.)

Xcode 通过保留对物理"文件或文件夹的引用来依赖文件系统组织.这就是为什么您可能将项目的所有类、图像、plist 和其他部分存储在同一个 文件夹 中,同时对这些部分的引用保持井井有条进入 Xcode 项目中各自的.

Xcode relies on filesystem organization by keeping a reference to a "physical" file or folder. That is why you may have all the classes, images, plists, and other parts of your projects stored in the same folder, while the references to these parts are being kept organized into respective groups within Xcode project.

当你创建一个组时,它会影响你的项目在 Xcode 中的组织.当您使用引用文件夹创建组时,它会同时创建 Xcode 项目中的组和文件系统中的文件夹.

When you create a group, it affects the organization of your project in Xcode. When you create a group with a reference folder, it creates both, a group in Xcode project and a folder in your filesystem.

然而,由于 Xcode 9 看来,Apple 强制文件系统项目结构与 Xcode 项目结构相对应.这意味着,您必须明确选择没有文件夹的新组"

However, since Xcode 9 it seems like, Apple enforces filesystem project structure to correspond to Xcode project structure. It means, that you explicitly has to choose "New Group without Folder"

这篇关于在 Xcode 中创建组与创建文件夹引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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