Cocoa Programming: For Mac OS X 5th Edition


This book will teach you what you need to know in order to develop full-featured applications for OS X. Written in an engaging tutorial style, it’s an invaluable resource for any Mac programmer.

About the Book

If you’re developing applications for OS X, Cocoa Programming for OS X: The Big Nerd Ranch Guide is the book you’ve been waiting to get your hands on. Written in a tutorial style and thoroughly bootcamp-tested to assure clarity and accuracy, it covers the bulk of what you need to know in order to develop full-featured OS X apps.

Updated for OS X Yosemite (10.10), Xcode 6 and Swift, this new edition introduces the two most commonly used developer tools: Xcode and Instruments. The authors also cover the Swift language, basic application architecture and the major design patterns of Cocoa. Examples are illustrated with exemplary code, written in the idioms of the Cocoa community, to show you how Mac apps should be written and architected.

Table of Contents

  1. Introduction
  2. Chapter 1: Let’s Get Started
  3. Chapter 2: Swift Types
  4. Chapter 3: Structures and Classes
  5. Chapter 4: Memory Management
  6. Chapter 5: Controls
  7. Chapter 6: Delegation
  8. Chapter 7: Working with Table Views
  9. Chapter 8: KVC, KVO, and Bindings
  10. Chapter 9: NSArrayController
  11. Chapter 10: Formatters and Validation
  12. Chapter 11: NSUndoManager
  13. Chapter 12: Archiving
  14. Chapter 13: Basic Core Data
  15. Chapter 14: User Defaults
  16. Chapter 15: Alerts and Closures
  17. Chapter 16: Using Notifications
  18. Chapter 17: NSView and Drawing
  19. Chapter 18: Mouse Events
  20. Chapter 19: Keyboard Events
  21. Chapter 20: Drawing Text with Attributes
  22. Chapter 21: Pasteboards and Nil-Targeted Actions
  23. Chapter 22: Drag-and-Drop
  24. Chapter 23:NSTimer
  25. Chapter 24: Sheets
  26. Chapter 25: Auto Layout
  27. Chapter 26: Localization and Bundles
  28. Chapter 27: Printing
  29. Chapter 28: Web Services
  30. Chapter 29: Unit Testing
  31. Chapter 30: View Controllers
  32. Chapter 31: View Swapping and Custom Container View Controllers
  33. Chapter 32: Storyboards
  34. Chapter 33: Core Animation
  35. Chapter 34: Concurrency
  36. Chapter 35: NSTask
  37. Chapter 36: Distributing Your App
  38. Chapter 37: Afterword

Swift 2 Companion Guide

This edition of our Cocoa programming guide was written for Xcode 6.3 and Swift 1.2. At WWDC 2015, Apple announced Xcode 7 and Swift 2, both of which introduce significant updates that (along with some changes to Cocoa for OS X 10.11) affect some of the exercises in this book. We have prepared a companion guide listing the changes needed to use Swift 2 and Xcode 7 to work through the exercises in the book.

About the Authors

Aaron Hillegass' Bio Pic

Aaron Hillegass has nearly two decades of experience programming and teaching Objective-C, Cocoa and iOS. In 2001, Aaron founded Big Nerd Ranch and began developing intensive courses that teach programming in a focused, distraction-free environment. Aaron is co-author of iOS Programming: The Big Nerd Ranch Guide and Objective-C Programming: The Big Nerd Ranch Guide.

Adam Preble's Bio Pic

Adam Preble learned Cocoa programming from the first edition of this book. After serving as Vice President of Engineering and instructor for our Cocoa bootcamps, Adam founded Ritual Development Group.

Nate Chandler's Bio Pic

Nate Chandler was a software engineer and instructor of Cocoa bootcamps at Big Nerd Ranch.