Book Review: Cocoa® Programming for Mac® OS X, Third Edition

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.

loading

Comments have been disabled for this post