Create Xcode Project

The instructions below show how to create a project for writing C code within Xcode, assuming you already have it downloaded and installed. In Xcode the only way to run code is to first create a project, then run the code from there. It seems painful, but once you get used to it, it is no big deal.

  1. Within Xcode, go to the File menu then select New, then select Project (Shorthand for this is: File / New / Project)

  2. Under the OS X category then select Application, and choose the "Command Line Tool" variation.

  1. You will then be prompted for a "Product Name". Below I typed in "sample" for this, and on the bottom pull-down menu also changed the option to be C (rather than C++):

  1. On the resulting screen you can select where it will be stored, and then select the "Create" button at the bottom right.

  2. It should give you something that looks like:

    1. Click ONCE on main.c (on the left file hierarchy) and it should open up for you to edit. If you click twice it will still work, but will open it up in a separate window.

  1. Once you are done editing it, select the triangle near the upper left of the window to run it.

  2. Presto!