Xcode Workspace

A workspace is an Xcode document that groups projects and other documents so you can work on them together. A workspace can contain any number of Xcode projects, plus any other files you want to include. In addition to organizing all the files in each Xcode project, a workspace provides implicit and explicit relationships among the included projects and their targets.

一个工作空间(workspace)是聚集了一些工程和文件的Xcode文件,这样你联合它们一起工作。一个工作空间可以包含任意多个Xcode 工程(project),也可以包含任何其它文件。除了组织每一个Xcode工程的所有文件,Xcode空间还提供包含的工程和target之间的隐式和显式的关系。

Workspaces Extend the Scope of Your Workflow

工作空间扩展你的工作流的范围

A project file contains pointers to all the files in the project, along with build configurations and other project information. In Xcode 3 and earlier, the project file is always the root of the group and file structure hierarchy. Although a project can contain references to other projects, working on interrelated projects in Xcode 3 is complicated; most workflows are confined to a single project. In Xcode 4 and later, you have the option of creating a workspace to hold one or more projects, plus any other files you wish to include.

一个工程文件包含了指向这个工程中所有文件的指针,以及编译配置和其他工程信息。在Xcode 3以及之前的版本,工程文件总是一个分组和文件结构层次的根目录。尽管一个工程可以包含对其他工程的引用,Xcode中处理互相关联的工程是复杂的;大部分工作流(workflow)被限定在一个单一的项目中。在Xcode 4以及之后的版本中,你创建一个工作空间后可以有选择地去包含一个或者多个工程,以及加上你想包含的其他文件。

In addition to providing access to all the files in each included Xcode project, a workspace extends the scope for many important Xcode workflows. For example, because indexing is done across the whole workspace, code completion, Jump to Definition, and all other content-aware features work seamlessly through all projects in the workspace. Because refactoring operations act across all the content of the workspace, you can refactor the API in a framework project and in several application projects that use that framework all in one operation. When building, one project can make use of the products of other projects in the workspace.

除了提供访问每一个包含的Xcode 工程中的所有文件,工作空间扩展了许多重要的Xcode工作流的范围。例如,由于在全工作空间中完成了索引,所以在工作空间的所有工程中,代码完成,跳转到定义,以及所有其他内容相关的特征都无缝地运转着。因为重构操作在工作空间的所有内容中起作用,所以你可以用一个操作重构框架工程中的API,以及重构使用那个框架的其它应用工程

The workspace document contains pointers to the included projects and other files, but no other data. A project can belong to more than one workspace. 

一个工程文件包含了指向这个工程中所有文件的指针,但是没有其他数据。一个工程不一定限定在一个工作空间,它还可以属于其它工作空间。

Projects in a Workspace Share a Build Directory

同一个工作空间中的工程共享一个编译目录

By default, all the Xcode projects in a workspace are built in the same directory, referred to as the workspace build directory. Each workspace has its own build directory. Because all of the files in all of the projects in a workspace are in the same build directory, all of these files are visible to each project. Therefore, if two or more projects use the same libraries, you don’t need to copy them into each project folder separately.

默认地,一个工作空间中所有的Xcode 工程在同一个目录中编译,被称为工作空间编译目录。每个工作空间有自己的构建目录。因为工作空间中的所有工程的所有文件都在相同的构建目录,所有这些文件对每个工程都是可见的。因此,如果两个或者更多工程用同样的库,你不需要分别把他们拷贝到对应的工程文件夹。

Xcode examines the files in the build directory to discover implicit dependencies. For example, if one project included in a workspace builds a library that is linked against by another project in the same workspace, Xcode automatically builds the library before building the other project, even if the build configuration does not make this dependency explicit. You can override such implicit dependencies with explicit build settings if necessary. For explicit dependencies, you must create project references.


Each project in a workspace continues to have its own independent identity. To work on a project without affecting—or being affected by—the other projects in the workspace, you can open the project without opening the workspace, or you can add the project to another workspace. Because a project can belong to more than one workspace, you can work on your projects in any number of combinations without having to reconfigure any of the projects or workspaces.

You can use the workspace’s default build directory or you can specify one. Note that if a project specifies a build directory, that directory is overridden by the build directory of whatever workspace the project is in at the time you build the project.



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值