Cocoa Programming for Mac OS X

Front Cover
Addison-Wesley, Nov 9, 2011 - Computers - 528 pages

The best-selling introduction to Cocoa, once again updated to cover the latest Mac programming technologies, and still enthusiastically recommended by experienced Mac OS X developers.

“Cocoa® Programming for Mac® OS X is considered by most to be the de-facto intro-to-OS X programming text.”

—Bob Rudis, the Apple Blog

“I would highly recommend this title to anyone interested in Mac development. Even if you own the previous edition, I think you’ll find the new and revised content well worth the price.”

—Bob McCune, bobmccune.com

If you’re developing applications for Mac OS X, Cocoa® Programming for Mac® OS X, Fourth Edition, is the book you’ve been waiting to get your hands on. If you’re new to the Mac environment, it’s probably the book you’ve been told to read first.

Covering the bulk of what you need to know to develop full-featured applications for OS X, written in an engaging tutorial style, and thoroughly class-tested to assure clarity and accuracy, it is an invaluable resource for any Mac programmer. Specifically, Aaron Hillegass and Adam Preble introduce the two most commonly used Mac developer tools: Xcode and Instruments. They also cover the Objective-C language and the major design patterns of Cocoa. Aaron and Adam illustrate their explanations with exemplary code, written in the idioms of the Cocoa community, to show you how Mac programs should be written. After reading this book, you will know enough to understand and utilize Apple’s online documentation for your own unique needs. And you will know enough to write your own stylish code.

Updated for Mac OS X 10.6 and 10.7, this fourth edition includes coverage of Xcode 4, blocks, view-based table views, Apple’s new approach to memory management (Automatic Reference Counting), and the Mac App Store. This edition adds a new chapter on concurrency and expands coverage of Core Animation. The book now devotes a full chapter to the basics of iOS development.

 

Contents

What Is It?
1
Chapter 2 Lets Get Started
11
Chapter 3 ObjectiveC
35
Chapter 4 Memory Management
67
Chapter 5 TargetAction
83
Chapter 6 Helper Objects
99
Chapter 7 KeyValue Coding and KeyValue Observing
117
Chapter 8 NSArrayController
129
Chapter 21 Pasteboards and NilTargeted Actions
295
Chapter 22 Categories
307
Chapter 23 DragandDrop
311
Chapter 24 NSTimer
321
Chapter 25 Sheets
329
Chapter 26 Creating NSFormatters
339
Chapter 27 Printing
353
Chapter 28 Web Services
359

Chapter 9 NSUndoManager
145
Chapter 10 Archiving
159
Chapter 11 Basic Core Data
177
Chapter 12 NIB Files and NSWindowController
193
Chapter 13 User Defaults
207
Chapter 14 Using Notifications
221
Chapter 15 Using Alert Panels
229
Chapter 16 Localization
233
Chapter 17 Custom Views
241
Chapter 18 Images and Mouse Events
257
Chapter 19 Keyboard Events
271
Chapter 20 Drawing Text with Attributes
285
Chapter 29 Blocks
371
Chapter 30 Developing for iOS
383
Chapter 31 View Swapping
397
Chapter 32 Core Data Relationships
407
Chapter 33 Core Animation
417
Chapter 34 Concurrency
427
Chapter 35 Cocoa and OpenGL
441
Chapter 36 NSTask
451
Chapter 37 Distributing Your App
461
Chapter 38 The End
471
Index
473
Copyright

Other editions - View all

Common terms and phrases

About the author (2011)

Aaron Hillegass, who worked at NeXT and Apple, now teaches popular Cocoa programming classes at Big Nerd Ranch. At NeXT, he wrote the first course on OpenStep, the predecessor to today’s Cocoa tools. This book is based on the big Nerd Ranch course and is influenced by more than a decade of work with OpenStep and Cocoa.

Adam Preble learned Cocoa programming from the first edition of this book. After too many years of professional C/C++ development, today Adam writes Mac and iOS applications at Big Nerd Ranch, where he is also a Cocoa instructor. He is frequently filling in the gaps between work and family time with pinball machine software development and countless other projects.

Bibliographic information