by Bert Altenburg, Alex Clarke and Philippe Mougin

This book aims to take you relatively painlessly through an introduction to the fundamental concepts in programming the Mac using Xcode and Objective-C.

It assumes no prior programming knowledge.


just starting to read
in the french version I saw

int x = 10;
float y= 3.5, z = 42;

would it be correct and less confusing to have
int x = 10, z = 42;
float y= 3.5;
because from what I understand 42 is an int

Submitted by g. (not verified) on Sun, 08/01/2010 - 11:12.
This would be correct: int x

This would be correct:

int x = 10, z = 42;
float y= 3.5;

And also this one:

int x = 10;
float y= 3.5, z = 4.2;

The declaration below is incorrect either the coder mistyped it or placed it in wrong place
int x = 10;
float y= 3.5, z = 42;

Submitted by Young_Turk (not verified) on Wed, 10/20/2010 - 04:45.
The Turkish version of this book.

Dear Alex..
I am new about MAC. My experience is all about Microsoft side. (vb,sql and dot.net etc.)
Two weeks before I bought a MAC computer. And I was looking for sources about MAC programming. That was very interesting there is no book (even one) in Turkish. After I saw this book I think this is good point to start basically.
It is very good work for fresh MAC users.If you allow me I want to translate in to Turkish and share with my peoples on the web. If you allow me I will be honored.Please inform me basically with an email.

Submitted by Turkish Version (not verified) on Sun, 02/28/2010 - 20:51.
Re: The Turkish version of this book.

Hi Yalcin,
I would be very pleased to have a Turkish version of BecomeAnXcoder available. Our aim is to have it translated into as many languages as possible. There are may ways to go about translating - you can do so in your word processor of choice, or I could create a new version of the online edition for you to edit collaboratively. I have Portuguese and Spanish versions coming along in this way as well.
Anyway, please email me at alex(at)cocoalab(dot)com so we can discuss it further.

Submitted by alex on Thu, 03/04/2010 - 09:20.
Snow Leopard?

Has this been updated for Snow Leopard? If not, are there many things that should be considered different, if a person is running the latest version of OS X?


Aaron K.

Submitted by Aaron (not verified) on Sun, 11/08/2009 - 11:52.

I have 30+ years of programming experience and every time I read through and tried various tutorials on programming with Cocoa/xCode, my head just spun and I got nowhere!

I don't need to know how to write code for linear regression (I have a masters in math). I don't need to know how to write a widget or bicycle inventory (I know what widgets and bikes I have)...

Until I stumbled across this site, I hadn't found anything that actually read well and got to the point regarding Interface Builder and setting up/making connections.

Your IB example clearly explained how and what to do and made all the difference in the world!

Thank you very much! I don't like to use PayPal or send credit card info but, if you email me with a mailing address, I will send you a check.

Submitted by Some Guy (not verified) on Mon, 11/30/2009 - 18:39.


Thank You for the great book! It has become my best resource on the web for trying to learn Objective-C.

However, I have recently been having trouble with understanding functions. Are arguments "properties" of a function, or variables that can be used for the function? I don't understand what occurs when an argument is placed in a function (e.x., float circleArea(float theRadius)).

Any help would be much appreciated.

Submitted by golfromeo (not verified) on Mon, 03/30/2009 - 20:50.
Re: functions

Hi golfromeo,

Thanks for the feedback, we are glad that you are finding the book helpful :-)

To answer your question, arguments are variables that are passed in to a function, so that the code inside the function definition can operate on them. In C generally, almost all code is written inside functions.

A C function looks like this (in pseudocode):

return_type  function(arg_type arg1, arg_type arg2... ) {
// Code to perform some function, eg
int x = arg1 + arg2;
// return something of the return type, in this case it's an int
return x;

The return_type and the arg_type must be pre-defined data types, like int or float. The arg1, etc, names are just arbitrary names you give those variables, which you can use to refer to them in your code.

Hope that makes things a bit clearer for you.

Submitted by alex on Sun, 04/05/2009 - 08:45.
Awesome Tutorial and Information for beginners

Thanks to Bert, Alex, and Philippe for writing BecomeAnXcoder for people who are truly new to Cocoa and Objective-C.
Just about all other resources I've found so far assume to much on the learner making the learning process difficult.

Submitted by Peter (not verified) on Sun, 03/22/2009 - 23:44.
Thank you! I have 1 question though...

Excellent guide - i'm picking up objective-c quite quickly due to your hard work. Cheers.

My question: In chapter 8 (the GUI intro) what is the exact neccessity for the MAFoo object? I understand how it works but surely the button objects can tell the textfield to display the values? To me the MAFoo object seems like a "middleman". If anyone could explain exactly why an external object is necessary that'd be really appreciated.


Submitted by Anonymous (not verified) on Thu, 02/12/2009 - 16:52.
Re: Thank you! I have 1 question though...

Hi Gavin,

You are right, in that any object can certainly message another object and tell it to change it's state. Buttons and text fields are objects, so sure, in this simple example, a middleman object is not strictly necessary.

It is included in this tutorial because, as your projects grow in scope, you will need to write your own classes and integrate them with your interface. Here we show you the basics of integrating such an object.

Google "Model View Controller" to understand the rationale that Cocoa adopts for the separation of class responsibilities. In a nutshell, application data is the model, the gui is the view, and you write controller classes to mediate between them. This chapter is preparatory to the techniques involved in MVC design.

Thanks for your feedback, and good luck learning Cocoa!

Submitted by alex on Thu, 02/19/2009 - 07:45.

Perfect work, but please, can somebody translate it to czech? Really thank you

Submitted by P-atr1k on Tue, 02/10/2009 - 15:25.
Re: Amazing

Thanks P-atr1k, we appreciate your enthusiasm! Any offers to translate to Czech, or any other language, are welcomed...

Submitted by alex on Thu, 02/19/2009 - 07:47.
Great stuff! Are you available for writing work?

Hey, Alex (at al.)! I can't believe I hadn't heard of "BecomeAnXcoder" before, and am blown away. This is great!

Are you (or your co-authors) available to write similar how-to articles on Cocoa programming? I have a client who pays well. Details are at http://gellerguides.com/jobs -- please contact me as described there if you're interested.

In any case, thanks for the great resource!

--Tom Geller
tomgeller.com, gellerguides.com

P.S. You're using Drupal, ain'tcha? ;)

Submitted by Tom Geller (not verified) on Fri, 10/31/2008 - 18:21.
Re: Great stuff! Are you available for writing work?

Hi Tom,

Thanks for the encouragement, and the offer!

I am currently in discussions for a writing project that will likely use all my time for the next few months. If it doesn't come through, I'll be in touch. I'll pass your offer on to Philippe and Bert.

Kind regards,


P.S. Yep! It is distinctive : )

Submitted by alex on Thu, 11/06/2008 - 05:53.
Great job Alex.

Great job Alex.

Submitted by Anonymous on Sat, 09/27/2008 - 11:35.
Update PDFs

Any chance you could update the PDFs?

Thank you very much for making this!

Submitted by Anonymous on Mon, 07/21/2008 - 16:50.

Just wondering where we can submit errata? I have looked around this site for contact details/editable wiki etc but cant seem to find anything.

I've noticed a few so far while reading through it, I think it would be useful to be able to jot them down somewhere. PS I'm very appreciative of the time and work put into this

this error stands out (pg 24, english leopard pdf):

pictureSurfaceArea = rectangleArea(pictureWidth, pictureHeight);
= circleArea(circleRadius);

Is missing the circleSurfaceArea variable

Submitted by the_snitch on Wed, 04/16/2008 - 23:40.

Hi Snitch,

You can submit errata to the comments for the appropriate chapter of the online book. Every so often these changes are merged back into the pdf. That particular error is presently awaiting correction in the next pdf, due in a couple of weeks.

Thanks for your comments.

Submitted by alex on Mon, 04/21/2008 - 06:52.
Finally an Xcode/Obj-C/Cocoa tutorial for C newbies!

I have extensive experience with Java but very very little experience with C or C++. I have been interested in learning Obj-C and Cocoa for the past year or so, but was never able to find a decent resource that didn't require previous C experience. I just stumbled across cocoalab last night and in just a few hours i have learned a great deal with much ease. I can't express how grateful I am! Please continue the great work!

Submitted by ImNotJimboJones on Tue, 03/11/2008 - 12:28.
I couldn't agree more. Ron

I couldn't agree more.

Ron Green

Submitted by rgreen on Tue, 03/18/2008 - 18:07.

I notice in the version of the book that covers the changes in Leopard, you do not cover properties. Is there a reason for this omission? Will you be adding it in the future?
Ron Green

Submitted by rgreen on Sat, 03/08/2008 - 05:02.

Hi Ron,

Yes, I have plans to write a chapter on properties in the coming weeks. Thanks for your feedback.

Submitted by alex on Sat, 03/08/2008 - 05:24.

Any update to when this might be available?

Submitted by rgreen on Thu, 03/27/2008 - 22:52.
New Chapter on properties

Hi Ron,

Just to let you know I have added a new chapter 14 on accessors and properties. Let me know what you think.

Submitted by alex on Sun, 04/06/2008 - 13:19.
New Chapter on Properties

I see the new chapter online but it's not in the PDF.

Ron Green

Submitted by rgreen on Mon, 04/07/2008 - 00:54.
New Chapter on properties

That's correct, updating the pdf is a fairly major task so I only do it infrequently, when I have a spare day. I was also interested in getting feedback before I roll it into the pdf. Changes like that have implications for the translations also, so I don't add or finalise chapters lightly.

Please add any comments you may have to chapter 14.


Submitted by alex on Mon, 04/07/2008 - 05:07.
previous version (BecomeAnXcoder for Xcode 2.x)


I found your tutorial very useful but sadly (for me) i'm still using a Tiger and Xcode 2.x, so I was wondering where can I get previous version of your book =)

Submitted by oisee (not verified) on Wed, 03/05/2008 - 09:48.
BecomeAnXcoder for Tiger

I have restored a link to the Tiger version of the book to the main page.

Submitted by alex on Sat, 03/08/2008 - 05:25.
thanks a lot! =)

thanks a lot! =)

Submitted by ooisee on Thu, 03/13/2008 - 18:34.
i've got it! =)

I've found it here -> BecomeAnXcoder v1.14 -> http://www.scribd.com/doc/7347/BecomeAnXcoder

Submitted by oisee (not verified) on Wed, 03/05/2008 - 09:57.
Updated online book

Thanks for your feedback guys. I'm glad to say that the online book has been updated for Leopard and Xcode 3. I have also eliminated the encoding problem. Enjoy!

Submitted by alex on Tue, 02/19/2008 - 10:56.
i've also found this

i've also found this tutorial extremely useful. There seems to be an encoding error on your apostrophes though. instead of "Apple's" i see "Apple’s". i've tried a few different encodings for viewing the site, but none gave the expected behavior.
thanks for the time and effort put into making this tutorial.

Submitted by harywilke on Tue, 02/05/2008 - 12:17.
BecomeAnXcoder for Xcode 3

I found your tutorial very useful but sadly (for me) I moved to Xcode 3 and I was wondering if you're planing to remake your tutorial for that version cause there's a lot of differences between the old Xcode and the new one so I can't complete the tutorial. I'm stuck when I need to create the class from interfacebuilder to put it in Xcode. If you could help me I'll be very happy.



Submitted by Gauvain on Fri, 12/28/2007 - 21:50.

Post new comment

The content of this field is kept private and will not be shown publicly.
Enter the code shown in the image:

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
15 + 2 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.


If you like what you find here and wish to support further development of this site, please donate via PayPal. No account required.


Syndicate content

User login

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
6 + 1 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.
Enter the code shown in the image: