Tables of Contents for Building Cocoa Applications
Understanding the Aqua Interface
3
58
What Makes Mac OS X So Special?
3
1
A Quick Look at the Mac OS X User Interface
4
2
Basic Principles of the Aqua Interface
6
3
Window Types and Behavior
12
8
Menus and the Menu Bar
20
2
Configuring Your Desktop, Step by Step
33
9
Menu Guidelines and Keyboard Equivalents
42
7
Working with the Filesystem, Step by Step
49
10
Tools for Developing Cocoa Applications
61
25
Working with the Terminal
69
9
Debugging Programs with gdb
78
6
Creating a Simple Application with Interface Builder
86
18
Getting Started with Interface Builder
87
5
Adding Objects to Your Application
92
4
Objects, Messages, and Targets
96
6
An Objective-C Application Without Interface Builder
104
37
An Introduction to Objective-C
109
20
Part II. Calculator: Building a Simple Application
Building a Project: A Four-Function Calculator
141
47
Getting Started: Building the Calculator Project
142
3
Building the Calculator's User Interface
145
6
Building the Calculator's Controller Class
151
12
Customizing Buttons and Making Connections
163
8
Compiling and Running a Program
171
3
Compiler Error Messages
174
2
The enterDigit: Action Method
176
1
Adding the Four Calculator Functions
177
3
Adding the Unary Minus Function to the Controller Class
180
3
The Files in a Project
183
3
Customizing MainMenu.nib
188
4
Managing Multiple Nibs
192
13
Adding Icons to Applications
205
3
Changing Calculator's Application Icon
208
5
Cocoa's NSImage Class
213
1
Delegation and Resizing
215
33
Handling Different Bases
215
10
Disabling Buttons for BetterMultiradix Input
232
5
Resizing Windows Programmatically
237
6
Two Very Important Classes: NSWindow and NSView
243
4
Events and Responders
248
29
Events and the NSResponder Chain
248
3
Events and the NSApplication Object
251
10
Catching Keyboard Events for Our Calculator
263
12
Darwin and the Window Server
277
16
Unix, Mach, and the Mac OS X Environment
277
5
The Window Server and Quartz
282
2
Seeing All the Processes
284
5
Part III. MathPaper: A Multiple-Document, Multiprocess Application
MathPaper and Cocoa's Document-Based Architecture
293
28
The MathPaper Application
293
2
The Evaluator Back End
295
7
Cocoa's Document-Based Architecture
302
1
Building MathPaper's Front End
302
16
Tasks, Pipes, and NSTextView
321
26
Processes, Pipes, and Resources
321
1
Making Evaluator a Mathpaper Auxiliary Executable
322
6
MathDocument Class Modifications
328
2
Creating PaperController, a Subclass of NSWindowController
330
5
The NSScrollView and NSTextView Classes
335
2
PaperController Class Modifications
337
9
Rich Text Format and NSText
347
17
Creating an RTF Class
356
3
Integrating Our RTF Class into MathPaper
359
3
Saving, Loading, and Printing
364
26
Data Management with NSDocument
364
6
Marking a Document Window as Edited
384
2
Adding Printing Capability
386
3
Animation in an About Panel
390
1
The Quartz Window Server
390
3
Implementing the About Panel in MathPaper
393
7
Quartz Graphics Data Types
400
8
Putting It All Together
410
6
Drawing in a Rectangle: More Fun with Cocoa Views
418
29
The Advantages of NSView's drawRect: Method
418
1
BlackView: An NSView That Paints Itself Black
419
3
A Closer Look at the NSView Class
422
6
BarView: An NSView with a Scaled Coordinate System
428
3
PolygonView: A Non-Opaque NSView
431
6
Responding to Events in an NSView
437
3
Autosizing Multiple Views in a Window
440
3
Part IV. GraphPaper: A Multithreaded, Mouse-Tracking Application
GraphPaper: A Multithreaded Application with a Display List
447
37
Working with Multiple Threads
450
4
Building the GraphPaper Application
454
22
Extending the Display List
476
6
Colors and Color Objects
484
4
Adding Color to GraphPaper
488
13
Adding Mouse Tracking to GraphPaper
506
5
Zooming and Saving Graphics Files
513
24
Adding a Zoom Button to GraphPaper
513
9
Creating an Accessory NSView
530
6
Pasteboards, Services, Modal Sessions, and Drag-and-Drop
537
35
Cut, Copy, and Paste with the Pasteboard
537
4
Using the Pasteboard in GraphPaper
541
5
Creating Your Own Service
549
11
Preferences and Defaults
572
25
Preferences and the Defaults Database system
573
6
Adding Defaults to GraphPaper
579
7
Making the Preferences Panel Work with Defaults
586
5
Setting Up a Multi-View Panel
591
4
Appendix: Cocoa Resources
597
8