Tuesday, May 20, 2014

Xcode Scheme, Target and Workspace

Xcode scheme 

Xcode Scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute. 

A user can have as many as scheme he want but only one can be active at a time. One can specify whether a scheme to be available inside a project or in every workspace that included in that project. 


Xcode Target

A target specifies a product to build and contains the instructions to build it from a set of files in a project or workspace. A target defines a single product, and it organises the inputs to the build system. The inputs to build a product is taken in form of build settings and build phases. A target inherits build settings but one can override any of the build settings by specifying different settings at the target level. There can be only one active target at a time. The Xcode scheme specifies the active target. 

A Target and the product it creates can be related to another target. If a target require another targets output, it can declare a dependancy. If the targets are in same workspace, Xcode will find the dependancy internally and such kinds of dependancy is called implicit dependency. 

Xcode workspace 

Xcode workspace is a document that groups together different projects and other documents so that one can work on them together. A workspace can contain any number of projects and files. A workspace can also provide implicit and explicit relationship between projects and their targets. 

The concept of Workspace was introduced only in Xcode 4.0 and later before that it was just a project file holding other project and project related files. 

There are few advantages of having a workspace. 

- Since the workspace share the scope for all of the projects and files inside, when there is a refactoring or code completion, it is globally affecting all of the files.




No comments:

Post a Comment