Preface |
|
xvii | |
Acknowledgments |
|
xix | |
Chapter 1 Cocoa: What Is It? |
|
1 | (10) |
|
|
1 | (3) |
|
|
4 | (1) |
|
|
4 | (1) |
|
Objects, Classes, Methods, and Messages |
|
|
5 | (1) |
|
|
6 | (1) |
|
|
7 | (1) |
|
Typographical Conventions |
|
|
7 | (1) |
|
|
8 | (1) |
|
|
8 | (3) |
Chapter 2 Let's Get Started |
|
11 | (26) |
|
|
11 | (5) |
|
|
12 | (3) |
|
|
15 | (1) |
|
|
16 | (10) |
|
|
16 | (1) |
|
|
17 | (1) |
|
|
17 | (2) |
|
|
19 | (1) |
|
|
20 | (3) |
|
|
23 | (1) |
|
|
24 | (2) |
|
|
26 | (6) |
|
Types and Constants in Objective-C |
|
|
28 | (1) |
|
Look at the I leader File |
|
|
28 | (1) |
|
Edit the Implementation File |
|
|
29 | (1) |
|
|
30 | (1) |
|
|
31 | (1) |
|
|
32 | (1) |
|
|
33 | (4) |
Chapter 3 Objective-C |
|
37 | (44) |
|
Creating and Using Instances |
|
|
37 | (2) |
|
|
39 | (16) |
|
Memory Management: Retain Count, Releasing, and Retaining |
|
|
46 | (2) |
|
|
48 | (1) |
|
NSObject, NSArray, NSMutableArray, and NSString |
|
|
49 | (5) |
|
"Inherits from" Versus "Uses" or "Knows About" |
|
|
54 | (1) |
|
Creating Your Own Classes |
|
|
55 | (19) |
|
Creating the LotteryEntry Class |
|
|
56 | (4) |
|
|
60 | (2) |
|
Implementing a description Method |
|
|
62 | (9) |
|
|
71 | (1) |
|
Initializers with Arguments |
|
|
72 | (2) |
|
|
74 | (4) |
|
|
78 | (1) |
|
For the More Curious: How Does Messaging Work? |
|
|
78 | (2) |
|
|
80 | (1) |
Chapter 4 Controls |
|
81 | (22) |
|
Some Commonly Used Subclasses of NSControl |
|
|
83 | (4) |
|
|
84 | (1) |
|
|
85 | (1) |
|
|
86 | (1) |
|
Start the SpeakLine Example |
|
|
87 | (2) |
|
|
89 | (5) |
|
Making Connections in Interface Builder |
|
|
91 | (3) |
|
Implementing the AppController Class |
|
|
94 | (5) |
|
Extending an Existing User Interface |
|
|
96 | (3) |
|
For the More Curious: Setting the Target Progranunatically |
|
|
99 | (1) |
|
|
100 | (3) |
Chapter 5 Helper Objects |
|
103 | (18) |
|
|
104 | (4) |
|
The NSTableView and Its dataSource |
|
|
108 | (2) |
|
AppController Interface File |
|
|
109 | (1) |
|
Lay Out the User Interface |
|
|
110 | (2) |
|
|
112 | (2) |
|
|
114 | (3) |
|
Common Errors in Implementing a Delegate |
|
|
116 | (1) |
|
Many Objects Have Delegates |
|
|
117 | (1) |
|
|
117 | (1) |
|
For the More Curious: How Delegates Work |
|
|
117 | (2) |
|
|
119 | (2) |
Chapter 6 Bindings and NSController |
|
121 | (18) |
|
Starting the RaiseMan Application |
|
|
122 | (9) |
|
|
126 | (1) |
|
|
127 | (4) |
|
|
131 | (1) |
|
|
132 | (1) |
|
For the More Curious: Sorting Without NSArrayController |
|
|
133 | (1) |
|
For the More Curious: Key Paths |
|
|
134 | (1) |
|
|
135 | (1) |
|
|
135 | (4) |
Chapter 7 NSUndoManager |
|
139 | (12) |
|
|
139 | (1) |
|
How the NSUndoManager Works |
|
|
140 | (3) |
|
|
143 | (3) |
|
|
146 | (1) |
|
|
147 | (2) |
|
For the More Curious: Windows and the Undo Manager |
|
|
149 | (2) |
Chapter 8 Archiving |
|
151 | (16) |
|
|
152 | (3) |
|
|
153 | (1) |
|
|
154 | (1) |
|
The Document Architecture |
|
|
155 | (4) |
|
Info.plist and NSDocumentController |
|
|
156 | (1) |
|
|
156 | (2) |
|
|
158 | (1) |
|
Saving and NSKeyedArchiver |
|
|
159 | (1) |
|
Loading and NSKeyedUnarchiver |
|
|
160 | (1) |
|
Setting the Extension and Icon for the File Type |
|
|
161 | (2) |
|
For the More Curious: Preventing Infinite Loops |
|
|
163 | (1) |
|
For the More Curious: Versioning |
|
|
164 | (2) |
|
For the More Curious: Creating a Protocol |
|
|
166 | (1) |
|
For the More Curious: Document-Based Applications Without Undo |
|
|
166 | (1) |
Chapter 9 Nib Files and NSWindowController |
|
167 | (16) |
|
|
167 | (1) |
|
Adding a Panel to the Application |
|
|
168 | (12) |
|
|
169 | (1) |
|
|
170 | (2) |
|
|
172 | (1) |
|
|
173 | (5) |
|
|
178 | (2) |
|
For the More Curious: NSBundle |
|
|
180 | (1) |
|
|
181 | (1) |
|
|
181 | (2) |
Chapter 10 User Defaults |
|
183 | (12) |
|
NSDictionary and NSMutableDictionary |
|
|
184 | (2) |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
186 | (1) |
|
Precedence of Different Types of Defaults |
|
|
187 | (1) |
|
Setting the Identifier for the Application |
|
|
188 | (1) |
|
Creating Keys for the Names of the Defaults |
|
|
188 | (1) |
|
|
189 | (1) |
|
Let the User Edit the Defaults |
|
|
189 | (2) |
|
|
191 | (3) |
|
Suppressing the Creation of Untitled Documents |
|
|
191 | (1) |
|
Setting the Background Color on the Table View |
|
|
192 | (2) |
|
For the More Curious: Reading and Writing Defaults from the Command Line |
|
|
194 | (1) |
|
|
194 | (1) |
Chapter 11 Using Notifications |
|
195 | (8) |
|
|
195 | (1) |
|
What Notifications Are Not |
|
|
196 | (1) |
|
|
196 | (1) |
|
|
196 | (3) |
|
|
199 | (1) |
|
Registering as an Observer |
|
|
199 | (1) |
|
Unregistering the Observer |
|
|
200 | (1) |
|
Handling the Notification When It Arrives |
|
|
200 | (1) |
|
For the More Curious: Delegates and Notifications |
|
|
201 | (1) |
|
For the More Curious: The userInfo Dictionary |
|
|
201 | (1) |
|
|
202 | (1) |
|
|
202 | (1) |
Chapter 12 Using Alert Panels |
|
203 | (4) |
|
Make the User Confirm the Deletion |
|
|
204 | (2) |
|
|
206 | (1) |
Chapter 13 Localization |
|
207 | (10) |
|
|
208 | (2) |
|
|
210 | (4) |
|
|
211 | (2) |
|
|
213 | (1) |
|
For the More Curious: nibtool |
|
|
214 | (1) |
|
For the More Curious: Explicit Ordering of Tokens in Format Strings |
|
|
215 | (2) |
Chapter 14 Custom Views |
|
217 | (16) |
|
|
217 | (2) |
|
Get a View to Draw Itself |
|
|
219 | (6) |
|
Create an Instance of a View Subclass |
|
|
221 | (1) |
|
|
222 | (1) |
|
|
223 | (2) |
|
Drawing with NSBezierPath |
|
|
225 | (2) |
|
|
227 | (2) |
|
For the More Curious: Cells |
|
|
229 | (2) |
|
For the More Curious: isFlipped |
|
|
231 | (1) |
|
|
232 | (1) |
Chapter 15 Images and Mouse Events |
|
233 | (16) |
|
|
233 | (1) |
|
|
233 | (2) |
|
|
235 | (1) |
|
|
235 | (7) |
|
|
237 | (3) |
|
|
240 | (1) |
|
|
240 | (2) |
|
Composite an Image onto Your View |
|
|
242 | (2) |
|
The View's Coordinate System |
|
|
244 | (2) |
|
|
246 | (1) |
|
For the More Curious: NSlmage |
|
|
247 | (1) |
|
|
248 | (1) |
Chapter 16 Responders and Keyboard Events |
|
249 | (16) |
|
|
251 | (1) |
|
|
251 | (1) |
|
Create a New Project with a Custom View |
|
|
252 | (9) |
|
|
252 | (5) |
|
|
257 | (4) |
|
For the More Curious: Rollovers |
|
|
261 | (4) |
Chapter 17 Working with Fonts and NSAttributedString |
|
265 | (10) |
|
|
265 | (1) |
|
Commonly Used Methods in NSFont |
|
|
265 | (1) |
|
|
266 | (2) |
|
Drawing Strings and Attributed Strings |
|
|
268 | (1) |
|
|
269 | (2) |
|
Getting Your View to Generate PDF Data |
|
|
271 | (3) |
|
For the More Curious: NSFontlVlanager |
|
|
274 | (1) |
|
|
274 | (1) |
|
|
274 | (1) |
Chapter 18 Pasteboards and Nil-Targeted Actions |
|
275 | (10) |
|
|
276 | (1) |
|
Add Cut, Copy, and Paste to BigLettcrVicww |
|
|
277 | (2) |
|
|
279 | (3) |
|
|
281 | (1) |
|
For the More Curious: Which Object Really Sends the Action Message? |
|
|
282 | (1) |
|
For the More Curious: Lazy Copying |
|
|
282 | (1) |
|
|
283 | (2) |
Chapter 19 Categories |
|
285 | (4) |
|
|
285 | (3) |
|
For the More Curious: Declaring Private Methods |
|
|
288 | (1) |
Chapter 20 Drag-and-Drop |
|
289 | (8) |
|
Make BigLetterView Be a Drag Source |
|
|
290 | (3) |
|
|
292 | (1) |
|
Make BigLetterView Be a Drag Destination |
|
|
293 | (4) |
|
|
293 | (1) |
|
|
294 | (1) |
|
Implement the Dragging Destination Methods |
|
|
295 | (1) |
|
|
296 | (1) |
Chapter 21 NSTimer |
|
297 | (8) |
|
|
298 | (2) |
|
|
300 | (2) |
|
Adding Code to AppController |
|
|
302 | (2) |
|
For the More Curious: NSRunLoop |
|
|
304 | (1) |
|
|
304 | (1) |
Chapter 22 Sheets |
|
305 | (12) |
|
|
306 | (6) |
|
|
307 | (1) |
|
|
307 | (3) |
|
|
310 | (2) |
|
For the More Curious: contextInfo |
|
|
312 | (1) |
|
For the More Curious: Modal Windows |
|
|
312 | (1) |
|
For the More Curious: Alert Sheets |
|
|
313 | (1) |
|
For the More Curious: NSIDr.nv cr |
|
|
313 | (2) |
|
|
315 | (2) |
Chapter 23 Creating NSFormatlers |
|
317 | (14) |
|
|
318 | (7) |
|
Edit the Interface File for the AppController Class |
|
|
319 | (1) |
|
|
320 | (1) |
|
|
320 | (1) |
|
Searching Strings for Substrings |
|
|
321 | (1) |
|
Create a Subclass of NSFormatter |
|
|
322 | (3) |
|
The Delegate of the NSControl |
|
|
325 | (1) |
|
|
326 | (2) |
|
Formatters That Return Attributed Strings |
|
|
328 | (1) |
|
|
329 | (2) |
Chapter 24 Printing |
|
331 | (12) |
|
Adding Printing to TypingTutor |
|
|
331 | (2) |
|
|
333 | (6) |
|
For the More Curious: Am I Drawing to the Screen? |
|
|
339 | (1) |
|
|
339 | (2) |
|
|
341 | (2) |
Chapter 25 Updating Menus |
|
343 | (8) |
|
Making a BigLetterView Uncopyable |
|
|
344 | (3) |
|
For the More Curious: Menu Delegates |
|
|
347 | (4) |
Chapter 26 Working with NSTextView |
|
351 | (18) |
|
|
351 | (2) |
|
Messages the Delegate Will Be Sent |
|
|
353 | (1) |
|
Build the Editor with Which This Book Was Written |
|
|
354 | (11) |
|
Read, Write, and Edit Text Files |
|
|
354 | (4) |
|
Add a Context-Sensitive Menu |
|
|
358 | (6) |
|
|
364 | (1) |
|
For the More Curious: The Field Editor |
|
|
365 | (2) |
|
|
367 | (2) |
Chapter 27 Creating Interface Builder Palettes |
|
369 | (20) |
|
Add NSCoding Methods to BigLetterView |
|
|
371 | (1) |
|
|
372 | (1) |
|
Edit the Nib File for Your Palette |
|
|
373 | (2) |
|
|
375 | (1) |
|
|
376 | (1) |
|
|
376 | (2) |
|
|
378 | (7) |
|
Create a Nib File for Your Inspector |
|
|
379 | (5) |
|
|
384 | (1) |
|
Adding Bindings to a Custom View |
|
|
385 | (2) |
|
For the More Curious: How to Palettize Objects That Are Not Views |
|
|
387 | (1) |
|
|
388 | (1) |
Chapter 28 AppleScript |
|
389 | (10) |
|
Making an Application AppleScript-able |
|
|
390 | (2) |
|
|
392 | (3) |
|
Handling the Apple Events |
|
|
395 | (4) |
Chapter 29 Cocoa and OpenGL |
|
399 | (8) |
|
A Simple Cocoa/OpenGL Application |
|
|
400 | (7) |
Chapter 30 Creating Frameworks |
|
407 | (10) |
|
|
408 | (3) |
|
Embed the Framework in an Application |
|
|
411 | (3) |
|
Compile the Framework for Embedding |
|
|
411 | (1) |
|
Compile the Application with the Framework |
|
|
412 | (2) |
|
|
414 | (1) |
|
|
415 | (2) |
Chapter 31 GNUstep |
|
417 | (10) |
|
Creating a System That Will Run GNUstep Applications |
|
|
418 | (1) |
|
Building and Starting the Development Tools |
|
|
419 | (1) |
|
Creating the RandomApp with GNUstep |
|
|
420 | (7) |
Chapter 32 The End |
|
427 | (2) |
Index |
|
429 | |