Learning Cocoa

Learning Cocoa is not hard, but it is not easy either. Part of the problem is that there is no royal road to knowledge. The other part is that what you need to learn to program in Cocoa depends on your background.

First, Learn C

If you have no background in programming whatsoever, and you want to learn how to program in Cocoa, you need to take three steps: learn C, learn Objective-C, learn Cocoa. The reason for this is that Cocoa is tightly integrated with Objective-C, and Objective-C is an extension of C.

Let’s start with learning C. You need to be somewhat familiar with C in order to program in Cocoa, but you don’t need to master C. You should be familiar with the basics: functions, variables, pointers, operators and flow-control.

There are a number of ways to get a handle on C. You can find several online tutorials, but in my experience there is no substitute for a good book. I suggest Learn C on the Mac by Dave Mark. This book will step you through downloading Xcode (the OS X development environment), writing your first program, and stepping into the details of C. This book is designed for those who have no background or do not know C or C-related languages (such as Java, C++, C#). Even though the book doesn’t go into a great deal of depth on many topics, it still goes deeper than you need at times. You can probably get away with working through the first eight chapters before you move to Objective-C.

Then, Learn Objective-C

If you already know C, you can jump right into Objective-C. If you know a C-related language, or have a lot of programming experience, you can almost certainly make the jump directly to Objective-C. I suggest looking at Learn C by Scott Stevenson, over at CocoaDevCentral, to make sure you are up to date on the basics of C.

At this point, you have two paths. If you want to master Objective-C first, which is not a bad idea, since as a Cocoa programmer you will be programming primarily in Objective-C, you should have a look at Learn Objective–C on the Mac by Mark Dalrymple and Scott Knaster. The continuation of Learn C on the Mac, this book teaches you what you need to know about Objective-C to start your journey in Cocoa. You could also look at Programming in Objective-C 2.0. This book is quite in-depth, and also covers what you need to know in C.

The Objective-C language, however, is a series of reasonably simple extensions to C. And if you’re a quick learning and don’t mind poking around a bit to get the details right, you can probably pick up what you need to know as you learn Cocoa. This is my preferred route.

Finally, Learn Cocoa

You can get a taste of Cocoa by going through the Learn Cocoa Tutorials by Scott Stevenson at CocoaDevCentral. But when you are ready to get serious, go directly to Cocoa Programming for Mac OS X (do not pass Go, do not collect $200) by Aaron Hillegass. This book will teach you the basics of Objective-C on the way to teaching you Cocoa, and is the gold standard for books on learning Cocoa.

One of the most thorny topics, when it comes to learning Cocoa, is memory management. If you are planning on writing programs exclusively for Mac OS X 10.5 Leopard and later (no the iPhone), you can rely on garbage collection almost exclusively. I suggest using garbage collection and skimming most the details about memory management, until you become more familiar with Cocoa.

Resources

Learning Cocoa can be a bit of a bumpy ride. There are two resources on the web that help smooth out the path dramatically: (i) CocoaDev is a wiki which contains much of the combined wisdom of Cocoa developers going back several years. (ii) CocoaBuilder hosts the cocoa-dev list archive. Cocoa-dev is the list where you can get help with Cocoa problems, big or small. Search the archive before posting a question, be as detailed as you can in your questions, and you will find people are both helpful and friendly.

August 30, 2009: ,

Commenting is closed for this article.

---
---

Our Software

Learn about Deductions
Learn about Intuition
Online Store

Recent Entries

Learning Cocoa

Categories

Business
Cocoa
Coding
Design
Development
Learning

Follow Us

RSS / Atom - Weblog syndication
Twitter - Follow us on Twitter
YouTube - Visit our YouTube channel

Google Analytics -->