Book 1: What you need

Home | Next

Ulis stylish xcode hammer

Computers really only understand ones and zeroes. Since it would be rather unwieldy to write your programs using only ones and zeroes, there are programming languages like C which are a more memorable text representation of a program, usually referred to as source code.

To write a program, one needs a text editor, and to translate this text representation of a program into actual ones and zeroes that the computer can run directly, we need a compiler. On the Mac, you usually use a program called Xcode, which is a text editor that integrates a compiler called “LLVM”.

If you’re just starting out with programming, you should get Xcode from the Mac App Store, for free. This is the full version of Xcode, but you will not be able to upload your finished application to the Mac App Store until you buy a one-year Mac Developer membership from Apple’s Developer Site.

MotV xcode in mac app store

Xcode has a few extra things it installs when you first run it. So after you have downloaded Xcode (it is a bit big, over 3GB last time I checked), just find “Xcode” in Launch Pad and click it. It will ask you to install some stuff, just let it do that.

MotV startup install sequence

This tutorial is for Xcode 4.4. Xcode changes a lot between versions, so make sure you have the newest version or it might be hard to follow along.

Home | Next

This entry was posted in C Tutorial. Bookmark the permalink.

20 Responses to Book 1: What you need

  1. Eugen says:

    I have oneWord[3] for you: “PDF\n” ; )

  2. Andy V2 says:

    Really good tutorial! enjoyed it. We want more tutorials like this one!

  3. DAS says:

    The trouble with the books that are available for so called “beginners” is they all too often assume you already know this and that hence once gets confused and throws an expensive investment into the rubbish bin. The books “X of Dummies” are a typical example. Among other titles I purchased “SQL for Dummies” and gave up after a few pages.
    I have only glanced at your content so far but from what I have seen it looks great! It is only a pity I didn’t discover your website BEFORE I spent all my money on unsuitable books. Keep up the good work.

  4. Michael Borges says:

    Muito bom esse material sobre Xcode. Meus parabéns!

  5. Lyn says:

    Looks a really nice first-timers course on Objective-C.

    But what has gone wrong with the on-screen formatting? On my PC and Mac, using any browser, Some pages have the sample code showing as one huge line, without a carriage return, which can’t really be followed smoothly.

    The formatting on Page-3 is fine, then it goes to all on one line again on page-4 and others.

    I hope this can be fixed.

  6. dharmeshtx says:

    I already learned c on pc. But I am proud user of mac now so I want to know what difference is with the Mac. Hope this journey has the great destination.

  7. Vilhelm says:

    Hey – can’t wait to get going! Thanks for the tutorial…

  8. [n3rve] says:

    I’ve just come across this site based on a recommendation I read from a blog post, and the content looks promising. I’ve attempted C/C++ and PHP and I have an idea of the syntax, hopefully I get along fine here. 🙂

  9. Uli Kusterer says:

    Supaman, I took down the PDF. They were getting out of date, and I couldn’t put the movies into the PDFs so one can print them, so there wasn’t much point in a PDF version.

  10. Supaman says:

    Hi, I am trying to find the PDF of this website but I can’t find it! However, a lot of people speak about it, does it actually officially exists? Thanks for this tutorial!

  11. Uli Kusterer says:

    Yeah. Look for GCC (The GNU compiler Collection) and any IDE (Integrated Development Environment) or text editor. Sadly, your choice depends a lot on what Linux distribution and window manager you’re using and similar things. I’m a Mac user, so I’m not really up to speed with all the different Linuxes out there, but maybe this will help you find the right one.

  12. Hi, are there tools for me to write & compile the app on a Win or Linux machine? I am a total noob in C programming and will want to learn to develop for iphone apps (was a programmer way back many many years).

  13. Uli Kusterer says:

    Efel, you need the right version of Xcode for your system version. If you still have your Mac OS X install CDs, there should be a folder with “additional installers” or something like that on it, containg an Xcode installer that will work on your OS X version. Alternately, log in at (if you don’t have an ADC login, get one, it’s free) and check out the Downloads section, I think if you scroll down you can find older Xcode versions there as well.

  14. Efel says:

    I use a Mac OS X 10.4.11, I searched for Xcode in the finder, but it didn’t find anything, then I downloaded it from the Apple website, but the installer wouldn’t open the file (Xcode.mpkg). Does anyone have any idea why?

  15. College student says:

    X code is awesome. I recently used it to program with the java language and it worked great! Now I will attempt to learn C with it.

  16. Garotas* says:

    Thanks Uli for putting up this site. This is so awesome.

  17. Uli Kusterer says:

    Sanjay, we’ll later get to having one project made up of several files.

    If you really meant create several programs as the final output (but this is a fairly advanced topic that won’t be covered in this tutorial), Xcode has “Targets” which can be used to create different programs with one project.

    You can also have several projects and then establish “dependencies” between them, by dragging one project’s icon into another project’s “Groups and Files” list, which will then make it show up in the “Dependencies” section of your Target’s “Info” window.

    Generally, Targets are used for variants of the same code (e.g. if you have a framework, and a command line tool that both do the same thing) and separate projects are used for actual different programs.

  18. Sanjay Shukla says:

    I found the content on this site a great guide to someone learning C on MAC using Xcode and is a beginner.

    I have one question?

    Can we have multiple program under one project (main.c , say another sub1.c )? And still abl to complie and run all of them at one go? How does this work?

    Thanks & Regards

  19. David says:

    Great tutorial on C. Memory allocation and use of pointers are clearly explained. Good for those who already know computer programming, either on C or other languages.

  20. Gnome says:

    Awesome article! I never even knew I had that app!

Leave a Reply

Your email address will not be published. Required fields are marked *