How are workspaces/projects/targets related?

Discussion in 'Mac Programming' started by ssawgift, Mar 30, 2012.

  1. ssawgift macrumors newbie

    Mar 23, 2012
    I'm completely new to xcode programming. I bought a MBP for only two weeks and am learning Objective-C and xcode IDE.

    One thing frustrates me - I don't understand what workspaces/projects/targets are for.

    I somewhat understand what workspace is. It is a loosely grouped container for many projects.

    But what about projects and targets? I can have many targets in one project but the targets can be very different types. What's relationship between project and target?

    Please explain...
  2. TreborM macrumors member

    Jun 26, 2010
    First disclaimer: I know next to nothing about Xcode

    Workspace in this context is simply a container used to configure, build, and deploy sets of related projects. There is a lot more to that...

    Project contain items that represent the references, data connections, folders, and files that you need to create your application (or library or something else). Again this is gross simplification...

    I presume that in this context Target is simply the hardware/software platform you are developing for.

    And the relationship between project and target? Projects normally produce something (executable, library are simple examples).

    The output from the project (output from the build process) is platform specific (CPU architecture, OS version amongst others).

    But very often your sources will be identical and only your project settings and some minor details have to be changed to build for different platform.
    Targets allows you to do that easily...

    Hope this helps, I find it difficult to explain this relatively simple concepts.
    Also the fact that you have to ask those questions means that you are probably aiming a bit too high at the moment.

    You definitely need to understand those concepts, but for now try to concentrate on the basics by taking advantage of the fact that most of the time the defaults should allow you to carry on coding.
    Stick with the simplest solution that works for you: no workspace, single project, single target, debug configuration.

    You will learn more about multiple targets/projects/workspaces when you need them...

    Good luck,
  3. Sydde macrumors 68020


    Aug 17, 2009
    Targets are build products. Typically, a target might be an app bundle, a framework, a prefPane, a unix command executable or some other compiler/linker output. Some projects may have multiple targets, like an app that has frameworks inside it, or a prefPane that has the UI component and the background component.

Share This Page