-
Cocoa Overview
-
Chapter 1 Understanding theAqua Interface
- What Makes Mac OS X So Special?
- A Quick Look at the Mac OS X User Interface
- Basic Principles of the Aqua Interface
- The Mouse and Cursor
- Window Types and Behavior
- Menus and the Menu Bar
- The Dock
- Controls
- The Finder
- Configuring Your Desktop, Step by Step
- Menu Guidelines and Keyboard Equivalents
- Working with the Filesystem,Step by Step
- Summary
- Exercises
- References
-
Chapter 2 Tools for Developing Cocoa Applications
- Developer Tools
- Utilities
- Working with the Terminal
- Debugging Programs with gdb
- User Interface Design
- Summary
- Exercises
-
Chapter 3 Creating a Simple Application with Interface Builder
- Getting Started with Interface Builder
- Adding Objects to Your Application
- Objects, Messages, and Targets
- Summary
- Exercise
-
Chapter 4 An Objective-C ApplicationWithout Interface Builder
- The Tiny.m Program
- An Introduction to Objective-C
- Tiny.m Revisited
- Summary
- Exercises
- References
-
-
Calculator: Building a Simple Application
-
Chapter 5 Building a Project: A Four-Function Calculator
- Getting Started: Building the Calculator Project
- Building the Calculator's User Interface
- Building the Calculator's Controller Class
- Customizing Buttons and Making Connections
- Compiling and Running a Program
- Compiler Error Messages
- The enterDigit: Action Method
- Adding the Four Calculator Functions
- Adding the Unary Minus Function to the Controller Class
- The Files in a Project
- Summary
- Exercises
-
Chapter 6 Nibs and Icons
- Customizing MainMenu.nib
- Managing Multiple Nibs
- Adding Icons to Applications
- Changing Calculator's Application Icon
- Cocoa's NSImage Class
- Summary
- Exercises
- References
-
Chapter 7 Delegation and Resizing
- Handling Different Bases
- Delegation
- Disabling Buttons for BetterMultiradix Input
- Resizing Windows Programmatically
- Two Very Important Classes: NSWindow and NSView
- Summary
- Exercises
-
Chapter 8 Events and Responders
- Events and the NSResponder Chain
- Events and the NSApplication Object
- The Event Loop
- Catching Keyboard Eventsfor Our Calculator
- Summary
- Exercises
- References
-
Chapter 9 Darwin and the Window Server
- Unix, Mach, and the Mac OS X Environment
- The Window Server and Quartz
- Seeing All the Processes
- Summary
- Exercises
- References
-
-
MathPaper: A Multiple-Document, Multiprocess Application
-
Chapter 10 MathPaper and Cocoa'sDocument-Based Architecture
- The MathPaper Application
- The Evaluator Back End
- Cocoa's Document-Based Architecture
- Building MathPaper's Front End
- Summary
- Exercises
- References
-
Chapter 11 Tasks, Pipes, and NSTextView
- Processes, Pipes, and Resources
- Making Evaluator a MathPaper Auxiliary Executable
- MathDocument Class Modifications
- Creating PaperController, a Subclass of NSWindowController
- The NSScrollView and NSTextView Classes
- PaperController Class Modifications
- Summary
- Exercises
-
Chapter 12 Rich Text Format and NSText
- Rich Text Format
- Creating an RTF Class
- Integrating Our RTF Class into MathPaper
- Summary
- Exercises
-
Chapter 13 Saving, Loading, and Printing
- Data Management with NSDocument
- Saving to a File
- Loading from a File
- Marking a Document Window as Edited
- Adding Printing Capability
- Summary
- Exercises
-
Chapter 14 Drawing with Quartz
- Animation in an About Panel
- The Quartz Window Server
- Implementing the About Panel in MathPaper
- Quartz Graphics Data Types
- Timers
- Putting It All Together
- Summary
- Exercises
- References
-
Chapter 15 Drawing in a Rectangle: More Fun with Cocoa Views
- The Advantages of NSView's drawRect: Method
- BlackView: An NSView That Paints Itself Black
- A Closer Look at the NSView Class
- BarView: An NSView with a Scaled Coordinate System
- PolygonView: A Non-Opaque NSView
- Responding to Events in an NSView
- Autosizing Multiple Views in a Window
- Summary
- Exercises
-
-
GraphPaper: A Multithreaded, Mouse-Tracking Application
-
Chapter 16 GraphPaper: A Multithreaded Application with a Display List
- GraphPaper's Design
- Working with Multiple Threads
- Building the GraphPaper Application
- Extending the Display List
- Summary
- Exercises
- References
-
Chapter 17 Color
- Colors and Color Objects
- Adding Color to GraphPaper
- Summary
- Exercises
-
Chapter 18 Tracking the Mouse
- Tracking the Mouse
- Adding Mouse Tracking to GraphPaper
- Summary
- Exercises
- References
-
Chapter 19 Zooming and Saving Graphics Files
- Adding a Zoom Button to GraphPaper
- Saving to PDF
- Saving to TIFF
- Creating an Accessory NSView
- Summary
- Exercises
-
Chapter 20 Pasteboards, Services, Modal Sessions, and Drag-and-Drop
- Cut, Copy, and Paste with the Pasteboard
- Using the Pasteboard in GraphPaper
- Services
- Creating Your Own Service
- Drag-and-Drop
- Summary
- Exercises
-
Chapter 21 Preferences and Defaults
- Preferences and the Defaults Database System
- Adding Defaults to GraphPaper
- Making the Preferences Panel Work with Defaults
- Setting Up a Multi-View Panel
- Summary
- Exercises
-
-
Appendix A Cocoa Resources
-
Apple Resources
-
Third-Party Resources
-
-
Colophon
- Title:
- Building Cocoa Applications: A Step by Step Guide
- By:
- Simson Garfinkel, Michael Mahoney
- Publisher:
- O'Reilly Media
- Formats:
-
- Safari Books Online
- Print Release:
- May 2002
- Pages:
- 646
- Print ISBN:
- 978-0-596-00235-0
- | ISBN 10:
- 0-596-00235-1
Our look is the result of reader comments, our own experimentation, and feedback from distribution channels. Distinctive covers complement our distinctive approach to technical topics, breathing personality and life into potentially dry subjects. The animal on the cover of Building Cocoa Applications is a Mastiff (also known as an English or Old English Mastiff ). The Mastiff is a large-breed working dog with a long history-Mastiffs have been used as guard and fighting dogs in England for more than 2,000 years, and dogs of this type are found in European and Asian records dating back to 3000 BC. Shakespeare referred to Mastiffs as "the dogs of war," and Henry VIII is known to have given King Charles V of Spain several hundred Mastiffs to use as fighting dogs on the battlefield. Trained fighting mastiffs were also used by the ancient Celts, by Kubla Khan, and by Hannibal when he crossed the Alps. Even as recently as the two World Wars, Mastiffs were used to pull munitions carts on the fronts.
Mastiff owners are often first attracted to the breed by its large size-Mastiffs are the heaviest dog breed, weighing in at an average of 180-220 pounds. Despite their history as fighting dogs, modern breeders have bred the Mastiff for gentleness and have created an excellent companion, large enough to deter intruders yet gentle enough to be dependable around children. Mastiffs are loyal, patient, affectionate, and protective, and they tend to bond strongly to their owners and become depressed during long periods of separation. Rachel Wheeler was the production editor and copyeditor for Building Cocoa Applications. Leanne Soylemez was the proofreader. Linley Dolby provided quality control, and Mary Brady, David Chu, Phil Dangler, Julie Flanagan, and Sue Willing provided production assistance. John Bickelhaupt wrote the index.
Emma Colby designed the cover of this book, based on a series design by Edie Freedman. The cover image is from the Dover Treasury of Animal Illustrations, edited by Carol Belanger Grafton. Emma Colby produced the cover layout with QuarkXPress 4.1 using Adobe's ITC Garamond font.
David Futato designed the interior layout. This book was converted into FrameMaker 5.5.6 with a format conversion tool created by Erik Ray, Jason McIntosh, Neil Walls, and Mike Sierra that uses Perl and XML technologies. The text font is Linotype Birka; the heading font is Adobe Myriad Condensed; and the code font is LucasFont's TheSans Mono Condensed. The illustrations that appear in the book were produced by Robert Romano and Jessamyn Read using Macromedia FreeHand 9 and Adobe Photoshop 6. The tip and warning icons were drawn by Christopher Bing. This colophon was written by Rachel Wheeler.
