Xcode 4 Build Settings are incomprehensible

Discussion in 'Mac Programming' started by mmcc, Aug 11, 2011.

  1. mmcc macrumors regular

    Joined:
    Nov 8, 2010
    Location:
    Tennessee
    #1
    Does anyone have a link to an up-to-date tutorial on how to manage the Build Settings for Xcode 4? I am completely lost. I thought Xcode 3 was bad enough, but I do not understand the build setting screens at all in Xcode 4. :confused:

    How do I associate specific build settings with debug, release, and archived versions of my code?

    The Project -> Info screen shows the Debug and Release options but then associates a "Configuration File" which by default is "None". What is a Configuration File? Also, when moving to the Build Settings screen the context is lost as it reverts to Resolved, Target, Project, and Default levels -- where is the context of Debug or Release indicated?

    And on top of all that I get buttons in the editor that say "My Mac (64-bit)" which again is confusing as nowhere in the Build Settings did I see anything that is labeled such. So what is "My Mac (64-bit)" using for the build settings other than 64-bit compilation? Is it debug or release?

    Thanks for any tips.
     
  2. MrFusion macrumors 6502a

    Joined:
    Jun 8, 2005
    Location:
    West-Europe
    #2
    If you want to know about adding (private) frameworks to your project, have a look at the post I made yesterday.

    Can I add this question? Where do you enable (or disable) ARC? I use c pointers in a few classes.
    If I understand the docs correctly, ARC can't be used under these circumstances.
     
  3. szymczyk macrumors regular

    Joined:
    Mar 5, 2006
    #3
    Answering your questions in order. If you move the mouse cursor over the name of a build setting, a disclosure triangle appears. Click the disclosure triangle. You should be able to see the values of the build setting for the debug and release versions of your project and change the values.

    A configuration file is a text file that contains build settings. If you find yourself changing the same build settings for all your projects, place those settings in a configuration file so you don't have to change them all the time. Configuration files are optional.

    My Mac (64-bit) means Xcode is going to run your project as a 64-bit application when you run it in Xcode. Choose Edit Scheme from the Scheme pop-up menu in the project window toolbar to control how Xcode builds, runs, tests, profiles, analyzes, and archives your project. Editing the scheme lets you specify what build configuration (debug or release) to use when running, testing, profiling, analyzing, or archiving your project.

    If you click the link in my signature, you can find a link to my blog. I have a bunch of Xcode 4 posts on the blog, which are tagged xcode 4. Apple also has WWDC 2011 videos available to view, but I'm not sure if you have to be a paid developer to access them. They have a session on schemes that would help you a lot.
     
  4. mmcc thread starter macrumors regular

    Joined:
    Nov 8, 2010
    Location:
    Tennessee
    #4
    Under Project -> Info I have, for example:

    Debug
    Release
    AppStore Distribution
    Ad-Hoc Distribution

    When I expand the disclosure triangle they all have the same Project and Target listed under them.

    However, when I go to the Project -> Build Settings I did finally recognize that each option has the above labels listed under them with a disclosure triangle. So I suppose now with Xcode 4 that the Build Settings shows ALL the build options for each setting. I think that is the thing that threw me the most initially.

    Ok, so it appears that the selection of Run, Test, Profile, Analyze, and Archive selects the Build Settings (per the Scheme) rather than selecting the build preference from a popup as it did in Xcode 3. I suppose the popup now only selects the device?

    I am still a bit fuzzy on what is a "Scheme", so I will look up that session and watch it as I am a paid developer. I think a Scheme simply associates build preferences to the Run, Test, Profile, Analyze, and Archive actions...

    Thanks!
     
  5. szymczyk macrumors regular

    Joined:
    Mar 5, 2006
    #5
    For a Mac app you can run the project in 32 or 64-bit mode, but some projects don't have a 32-bit option initially. For an iOS app, you can choose to run on the device or simulator. If you have a workspace, which is essentially the project window but allows you to have multiple projects in it, you can also pick the project to run.
     

Share This Page