Addison Wesley Professional started shipping the Third Edition of Cocoa Programming for Mac OS X by Aaron Hillegass this month. Hillegass’ book is considered my most to be the de-facto intro-to-OS X programming text. I own (and have now recycled) the first edition of the book […]

Addison Wesley Professional started shipping the Third Edition of Cocoa Programming for Mac OS X by Aaron Hillegass this month. Hillegass’ book is considered my most to be the de-facto intro-to-OS X programming text. I own (and have now recycled) the first edition of the book and have gone through the majority of the Third Edition (at least reading-wise). Here’s my take on this latest incarnation.

The Text At A Glance

Aaron has a great, teaching-writing style. You definitely get the feel of being in the classroom, learning right from the professor. The preface makes at least two, fairly substantial claims. First, that the nook covers the Objective-C language, Cocoa design patterns and how to use Xcode, Interface Builder and Instruments. And, second, that you will learn 80% of what you need to know to get started programming for the Mac. I have to agree with both claims as you will definitely learn a great deal of the fundamentals of the language and tools and that the book can be used as a reference post-read.

This third edition has been updated to cover Leopard-only technologies (such as garbage collection and Objective-C 2.0) and does a decent job showing where to utilize the new language features and delves into the depths of intricacies of the new memory management facilities in Leopard (and how to code for both Tiger & Leopard). Covering tools like gdb and Instruments is an amazing thing to do, since many programmers are still rely solely on printf or (in the case of Mac programming) NSLog.

The sample applications range from trivial to pretty neat & indicative of real-world Mac programming, error-logic and all. I especially like the challenges in the exercises, many of which have you modify example code, sometimes accompanied by the mantra: “This is hard, and you are not stupid.”

If you are interested at all in programming for OS X or have programmed for the Mac and want to pick up some hints on how code specifically for features in Leopard, Aaron’s books is a must-buy. I’d definitely recommend keeping all of Apple’s updated Objective-C 2.0 information handy as it will fill in the 20% Aaron doesn’t cover and go a bit deeper as well.

The Gory Details

Here is a breakdown of the chapters and what each covers:

  • Chapter 1. Cocoa: What Is It?
  • Chapter 2. Let’s Get Started
  • Chapter 3. Objective-C
  • Chapter 4. Memory Management
  • Chapter 5. Target/Action
  • Chapter 6. Helper Objects
  • Chapter 7. Key-Value Coding; Key-Value Observing
  • Chapter 8. NSArrayController
  • Chapter 9. NSUndoManager
  • Chapter 10. Archiving
  • Chapter 11. Basic Core Data
  • Chapter 12. Nib Files and NSWindowController
  • Chapter 13. User Defaults
  • Chapter 14. Using Notifications
  • Chapter 15. Using Alert Panels
  • Chapter 16. Localization
  • Chapter 17. Custom Views
  • Chapter 18. Images and Mouse Events
  • Chapter 19. Keyboard Events
  • Chapter 20. Drawing Text with Attributes
  • Chapter 21. Pasteboards and Nil-Targeted Actions
  • Chapter 22. Categories
  • Chapter 23. Drag-and-Drop
  • Chapter 24. NSTimer
  • Chapter 25. Sheets
  • Chapter 26. Creating NSFormatters
  • Chapter 27. Printing
  • Chapter 28. Web Service
  • Chapter 29. View Swapping
  • Chapter 30. Core Data Relationships
  • Chapter 31. Garbage Collection
  • Chapter 32. Core Animation
  • Chapter 33. A Simple Cocoa/OpenGL Application
  • Chapter 34. NSTask
  • Chapter 35. The End

(Choosing to cover topics such as threading is a huge plus and not the normal faire for this type of text)

Full book reference information:

Title: Cocoa® Programming for Mac® OS X, Third Edition
Publisher: Addison Wesley Professional
Publish Date: May 05, 2008
Print ISBN-10: 0-321-50361-9
Print ISBN-13: 978-0-321-50361-9
eText ISBN-10: 0-321-56273-9
eText ISBN-13: 978-0-321-56273-9
Pages: 464

You can find it at Amazon (they even have a Kindle-ready version), Safari Books Online and (most likely) at your favorite local bookstore.

List price is $49.99 USD but you can find it in the low $30’s if you poke around.

If you snagged a copy of the tome, drop a note in the comments with your take on the text.

You’re subscribed! If you like, you can update your settings

  1. Given all the currently shipping Macs now have 2+ cores, threading MUST be included these days. Yes, I realize it can be complicated, and no I haven’t read this book as of yet.. But having programmed for the past 15 years in multi threading environments, I can attest to how brutally painful it is to use (let alone work on / fix) programs which obviously haven’t taking threading into account. Even relatively new products (Aperture!) which by all accounts should have done it right given their age, don’t.. So lets, please!, change this thought of “threads are too hard for beginners” and find a way to set this world up to use the 16+ cores we’re soon to have..

  2. signal response » Blog Archive » Cocoa Programming. Tuesday, May 20, 2008

    [...] Apple Blog reviews the third edition of Cocoa Programming for Mac OS X, a book I have been waiting for after special [...]

  3. I received mine last Monday. I have no programming experience in Mac, but I am moving along at an amazing speed. I am in chapter 7 and so far I have nothing to complain. Great buy.

  4. Scott Freer Tuesday, May 20, 2008

    This is a great book. The only thing better is the course Aaron teaches at the Big Nerd Ranch – he uses this book as the course material. I took the course this April and it was well worth the money. If you want a jumpstart into Cocoa development, the Cocoa course is perfect.


  5. Thanks for blogging about this book! I’ve been working out of a well-beaten copy of the first edition, and despite much TLC administered, the poor thing’s falling apart. I’ve been meaning to look for a used copy on Amazon, but now it looks like I don’t have to.

    Stumbled upon this blog not too long ago looking for Quicksilver video tutorials. Glad I bookmarked it.

  6. I’ll second Victor’s comments – I received my copy last weekend, and I’m working through it now. I have quite a bit of experience programming on Windows, but when I started looking into Mac programming, I just didn’t know where to start. This book has been a great help to get me going on Mac development.

  7. Cocoa for Win32 @ Luther Baker Tuesday, April 28, 2009

    [...] I want to do some iPhone development and I need to start learning Cocoa so I started working my way through Allen Hillegas‘ book Cocoa Programming for Mac OS X, 3rd Ed. [...]

  8. I had downloaded some chapters from the internet as this book wasn’t available in India but I found it to be a great book for somebody learning up front that I had to order it from amazon.com
    I got mine in March. I’ve been studying it at a steady pace but Aaron explains it well. A good buy if you wanna start development on the MAC.

  9. I’m an absolute beginner in Macs at all and this book is great for a first timer.

  10. This is the error I get when I try to compile and run any thing *** Terminating app due to uncaught exception ‘NSInternalInconsistencyException’, reason : ‘Cannot create BOOL from object of class _NSControllerObjectProxy’ This same error comes up on things that used to run fine.

Comments have been disabled for this post