Building Cocoa Applications: A Step by Step Guide
By
Simson Garfinkel,
Michael Mahoney
May 2002
Pages: 646
| Table of Contents
| Index
| Sample Chapter
| Colophon
Table of Contents
-
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
Return to Building Cocoa Applications: A Step by Step Guide