| Acknowledgements |
|
xv | |
|
|
|
1 | (4) |
|
|
|
1 | (1) |
|
|
|
2 | (1) |
|
Typographical Conventions |
|
|
3 | (1) |
|
|
|
3 | (2) |
|
|
|
5 | (32) |
|
|
|
5 | (2) |
|
|
|
6 | (1) |
|
|
|
6 | (1) |
|
Defining Preprocessor Symbols |
|
|
7 | (2) |
|
Seeing Preprocessor Output |
|
|
9 | (1) |
|
Seeing the Generated Assembly Code |
|
|
10 | (1) |
|
Preprocessor Hints and Tricks |
|
|
11 | (5) |
|
|
|
11 | (2) |
|
|
|
13 | (1) |
|
|
|
14 | (2) |
|
|
|
16 | (5) |
|
|
|
20 | (1) |
|
|
|
21 | (1) |
|
|
|
22 | (1) |
|
|
|
23 | (3) |
|
|
|
23 | (1) |
|
Testing the Compiler Version |
|
|
24 | (1) |
|
|
|
25 | (1) |
|
|
|
25 | (1) |
|
|
|
26 | (2) |
|
|
|
28 | (2) |
|
The 64-bit Programming Model |
|
|
28 | (1) |
|
|
|
29 | (1) |
|
|
|
30 | (1) |
|
|
|
30 | (7) |
|
Fat Binaries from the Command Line |
|
|
30 | (4) |
|
|
|
34 | (3) |
|
|
|
37 | (36) |
|
|
|
37 | (4) |
|
|
|
41 | (2) |
|
|
|
43 | (5) |
|
|
|
46 | (2) |
|
|
|
48 | (9) |
|
|
|
48 | (5) |
|
|
|
53 | (4) |
|
Shared Libraries and dlopen |
|
|
57 | (3) |
|
|
|
57 | (1) |
|
|
|
58 | (1) |
|
|
|
59 | (1) |
|
Embedding Frameworks in Applications |
|
|
60 | (10) |
|
|
|
61 | (4) |
|
|
|
65 | (3) |
|
Cross-Project Dependencies |
|
|
68 | (2) |
|
ranlib and Source Code Management |
|
|
70 | (2) |
|
For The More Curious: Optimizing the system |
|
|
72 | (1) |
|
|
|
72 | (1) |
|
|
|
73 | (12) |
|
|
|
73 | (2) |
|
|
|
75 | (1) |
|
|
|
76 | (1) |
|
Looking at the Environment |
|
|
77 | (2) |
|
|
|
79 | (4) |
|
For the More Curious: getopt() |
|
|
83 | (2) |
|
|
|
85 | (38) |
|
|
|
85 | (1) |
|
|
|
85 | (1) |
|
Differences From Classic Mac OS Memory Management |
|
|
86 | (1) |
|
|
|
87 | (3) |
|
|
|
90 | (1) |
|
Dynamic Memory Allocation |
|
|
90 | (6) |
|
|
|
91 | (3) |
|
|
|
94 | (1) |
|
|
|
94 | (1) |
|
|
|
95 | (1) |
|
|
|
96 | (1) |
|
|
|
96 | (5) |
|
Debugging Memory Problems |
|
|
101 | (8) |
|
|
|
101 | (1) |
|
|
|
102 | (1) |
|
|
|
103 | (1) |
|
|
|
104 | (1) |
|
MallocStackLogging and MallocStackLoggingNoCompact |
|
|
105 | (1) |
|
|
|
105 | (2) |
|
|
|
107 | (1) |
|
|
|
107 | (1) |
|
|
|
108 | (1) |
|
|
|
109 | (11) |
|
|
|
109 | (2) |
|
|
|
111 | (5) |
|
|
|
116 | (3) |
|
|
|
119 | (1) |
|
|
|
119 | (1) |
|
|
|
120 | (3) |
|
|
|
123 | (30) |
|
|
|
123 | (1) |
|
Using GDB From The Command Line |
|
|
123 | (13) |
|
|
|
123 | (13) |
|
|
|
136 | (1) |
|
|
|
136 | (1) |
|
|
|
137 | (1) |
|
|
|
138 | (1) |
|
|
|
139 | (1) |
|
|
|
140 | (2) |
|
|
|
142 | (1) |
|
|
|
142 | (1) |
|
|
|
142 | (2) |
|
|
|
144 | (2) |
|
|
|
145 | (1) |
|
|
|
146 | (1) |
|
|
|
146 | (5) |
|
|
|
147 | (3) |
|
|
|
150 | (1) |
|
More Advanced GDB Commands |
|
|
151 | (2) |
|
|
|
151 | (2) |
|
Exceptions, Error Handling, and Signals |
|
|
153 | (34) |
|
|
|
153 | (3) |
|
|
|
156 | (2) |
|
|
|
158 | (1) |
|
|
|
158 | (2) |
|
|
|
160 | (5) |
|
Handling signals with sigaction () |
|
|
164 | (1) |
|
|
|
165 | (4) |
|
|
|
165 | (3) |
|
|
|
168 | (1) |
|
Exception-Handling in Cocoa |
|
|
169 | (7) |
|
Classic Exception-Handling |
|
|
169 | (3) |
|
Native Exception-Handling |
|
|
172 | (3) |
|
Subclassing NSApplication to catch exceptions |
|
|
175 | (1) |
|
|
|
176 | (9) |
|
|
|
176 | (2) |
|
|
|
178 | (1) |
|
|
|
178 | (2) |
|
|
|
180 | (5) |
|
|
|
185 | (2) |
|
|
|
185 | (1) |
|
|
|
186 | (1) |
|
Files, Part 1: I/O and Permissions |
|
|
187 | (46) |
|
|
|
187 | (14) |
|
|
|
187 | (3) |
|
|
|
190 | (2) |
|
|
|
192 | (2) |
|
|
|
194 | (1) |
|
Changing the Read/Write Offset |
|
|
194 | (1) |
|
|
|
195 | (2) |
|
|
|
197 | (4) |
|
|
|
201 | (1) |
|
|
|
201 | (1) |
|
|
|
201 | (8) |
|
|
|
202 | (1) |
|
|
|
203 | (1) |
|
|
|
203 | (2) |
|
|
|
205 | (3) |
|
|
|
208 | (1) |
|
|
|
209 | (1) |
|
|
|
209 | (1) |
|
Buffered I/O vs. Unbuffered I/O |
|
|
210 | (1) |
|
|
|
210 | (2) |
|
|
|
212 | (2) |
|
|
|
214 | (9) |
|
|
|
214 | (2) |
|
|
|
216 | (7) |
|
|
|
223 | (1) |
|
Permission-Check Algorithms |
|
|
224 | (2) |
|
For the More Curious: Memory-Mapped files |
|
|
226 | (7) |
|
Files, Part 2: Directories, File Systems, and Links |
|
|
233 | (40) |
|
|
|
233 | (6) |
|
|
|
233 | (1) |
|
|
|
233 | (1) |
|
|
|
233 | (2) |
|
|
|
235 | (4) |
|
Current working directory |
|
|
239 | (1) |
|
|
|
239 | (2) |
|
|
|
241 | (4) |
|
|
|
242 | (1) |
|
|
|
242 | (3) |
|
|
|
245 | (1) |
|
|
|
245 | (1) |
|
|
|
245 | (19) |
|
|
|
245 | (6) |
|
|
|
251 | (1) |
|
Describing the Attributes |
|
|
252 | (2) |
|
|
|
254 | (4) |
|
|
|
258 | (6) |
|
Mac OS X Specific Weirdness |
|
|
264 | (1) |
|
|
|
264 | (1) |
|
|
|
264 | (1) |
|
|
|
265 | (1) |
|
|
|
265 | (6) |
|
Differences between HFS+ and UFS |
|
|
265 | (1) |
|
|
|
266 | (2) |
|
|
|
268 | (1) |
|
|
|
269 | (1) |
|
|
|
269 | (1) |
|
|
|
270 | (1) |
|
|
|
271 | (2) |
|
|
|
273 | (16) |
|
|
|
273 | (1) |
|
|
|
274 | (12) |
|
Create the DirEntry Class |
|
|
275 | (3) |
|
Create a nib file using NSTreeController |
|
|
278 | (5) |
|
Using NSBrowser and DirEntry |
|
|
283 | (1) |
|
|
|
284 | (2) |
|
|
|
286 | (1) |
|
|
|
287 | (2) |
|
Network Programming With Sockets |
|
|
289 | (36) |
|
|
|
289 | (1) |
|
The Address Data Structures |
|
|
290 | (1) |
|
|
|
290 | (1) |
|
|
|
291 | (1) |
|
|
|
291 | (1) |
|
|
|
292 | (3) |
|
IPv4 and IPv6 Compatible Functions |
|
|
292 | (3) |
|
|
|
295 | (1) |
|
|
|
295 | (3) |
|
Simple Network Programming |
|
|
298 | (5) |
|
|
|
298 | (1) |
|
|
|
299 | (1) |
|
|
|
299 | (1) |
|
|
|
299 | (1) |
|
|
|
300 | (3) |
|
|
|
303 | (3) |
|
|
|
303 | (3) |
|
|
|
306 | (16) |
|
|
|
306 | (3) |
|
|
|
309 | (13) |
|
|
|
322 | (1) |
|
|
|
322 | (1) |
|
|
|
323 | (2) |
|
|
|
325 | (26) |
|
|
|
325 | (3) |
|
|
|
328 | (9) |
|
The System Configuration Framework |
|
|
337 | (4) |
|
|
|
337 | (1) |
|
|
|
338 | (3) |
|
|
|
341 | (2) |
|
|
|
343 | (5) |
|
|
|
348 | (2) |
|
|
|
350 | (1) |
|
|
|
351 | (28) |
|
|
|
351 | (1) |
|
|
|
352 | (1) |
|
|
|
353 | (3) |
|
Parent And Child Lifetimes |
|
|
356 | (4) |
|
|
|
360 | (2) |
|
|
|
362 | (4) |
|
Gotchas with Cocoa and fork() |
|
|
366 | (1) |
|
|
|
367 | (10) |
|
|
|
367 | (10) |
|
|
|
377 | (1) |
|
|
|
377 | (2) |
|
|
|
379 | (12) |
|
|
|
379 | (1) |
|
|
|
379 | (1) |
|
|
|
380 | (1) |
|
|
|
381 | (1) |
|
Creating an App that Creates a New Process |
|
|
381 | (4) |
|
|
|
385 | (6) |
|
|
|
386 | (1) |
|
|
|
387 | (4) |
|
|
|
391 | (18) |
|
|
|
391 | (1) |
|
|
|
392 | (1) |
|
Registering and Handling Events |
|
|
393 | (2) |
|
kqueues for Signal Handling |
|
|
395 | (3) |
|
kqueues for Socket Monitoring |
|
|
398 | (1) |
|
kqueues for File System Monitoring |
|
|
399 | (3) |
|
|
|
402 | (5) |
|
|
|
407 | (2) |
|
|
|
409 | (16) |
|
Items and Attribute Lists |
|
|
410 | (2) |
|
|
|
412 | (2) |
|
Reading Data From an Item |
|
|
414 | (2) |
|
|
|
416 | (1) |
|
Getting Specific Keychains |
|
|
416 | (1) |
|
|
|
417 | (2) |
|
Making a New Keychain Item |
|
|
419 | (2) |
|
|
|
421 | (2) |
|
|
|
423 | (2) |
|
|
|
425 | (22) |
|
The Security Framework API |
|
|
426 | (1) |
|
Passing authorization to a SUID tool |
|
|
427 | (2) |
|
Add Authentication to Remover |
|
|
429 | (14) |
|
|
|
429 | (2) |
|
|
|
431 | (3) |
|
|
|
434 | (9) |
|
For the More Curious: AuthorizationExecuteWithPrivileges() |
|
|
443 | (2) |
|
For the More Curious: Computing a Checksum |
|
|
445 | (1) |
|
|
|
445 | (2) |
|
|
|
447 | (16) |
|
Distributed Objects Concepts |
|
|
447 | (2) |
|
|
|
448 | (1) |
|
|
|
449 | (5) |
|
|
|
454 | (7) |
|
For the more curious: NSPortCoder |
|
|
461 | (1) |
|
Bindings and Distributed Objects |
|
|
461 | (2) |
|
|
|
463 | (8) |
|
Publishing an NSNetService |
|
|
463 | (2) |
|
Make chatterd Zeroconf-compliant |
|
|
464 | (1) |
|
|
|
465 | (4) |
|
Make ChatterClient browse for servers |
|
|
466 | (3) |
|
For the More Curious: TXT Records |
|
|
469 | (1) |
|
|
|
470 | (1) |
|
|
|
471 | (18) |
|
|
|
472 | (5) |
|
|
|
477 | (1) |
|
|
|
477 | (1) |
|
|
|
477 | (1) |
|
|
|
478 | (3) |
|
|
|
479 | (1) |
|
|
|
480 | (1) |
|
|
|
481 | (8) |
|
Accessing Configuration Information |
|
|
482 | (2) |
|
|
|
484 | (5) |
|
|
|
489 | (20) |
|
Directory Server Concepts |
|
|
490 | (1) |
|
Open Directory Data Structures |
|
|
491 | (4) |
|
|
|
491 | (1) |
|
|
|
491 | (1) |
|
|
|
492 | (1) |
|
|
|
492 | (1) |
|
tRecordEntry and tAttributeList |
|
|
492 | (2) |
|
tAttributeValueList, tAttributeEntry, and tAttributeValueEntry |
|
|
494 | (1) |
|
|
|
495 | (5) |
|
|
|
500 | (5) |
|
|
|
505 | (2) |
|
|
|
507 | (2) |
|
|
|
509 | (30) |
|
|
|
509 | (19) |
|
|
|
509 | (4) |
|
|
|
513 | (1) |
|
|
|
514 | (2) |
|
|
|
516 | (1) |
|
|
|
517 | (11) |
|
|
|
528 | (7) |
|
|
|
528 | (3) |
|
|
|
531 | (1) |
|
Objective-C @synchronized Blocks |
|
|
531 | (4) |
|
For the More Curious: Thread Local Storage |
|
|
535 | (1) |
|
For the More Curious: Read/Write Locks |
|
|
536 | (1) |
|
|
|
537 | (2) |
|
Using Distributed Objects Between Threads |
|
|
539 | (14) |
|
``Each Server In Its Own Thread'' Design |
|
|
539 | (11) |
|
Generate the Mandelbrot set |
|
|
539 | (9) |
|
|
|
548 | (2) |
|
performSelectorOnMainThread: |
|
|
550 | (1) |
|
|
|
551 | (1) |
|
|
|
551 | (2) |
|
|
|
553 | (28) |
|
|
|
554 | (1) |
|
|
|
555 | (4) |
|
|
|
555 | (1) |
|
|
|
556 | (1) |
|
Multi-Project Repositories |
|
|
556 | (1) |
|
|
|
557 | (1) |
|
|
|
558 | (1) |
|
|
|
559 | (9) |
|
|
|
559 | (1) |
|
|
|
560 | (1) |
|
|
|
561 | (1) |
|
|
|
562 | (1) |
|
|
|
562 | (1) |
|
|
|
562 | (1) |
|
|
|
563 | (1) |
|
|
|
564 | (1) |
|
|
|
565 | (1) |
|
|
|
565 | (3) |
|
|
|
568 | (2) |
|
|
|
568 | (1) |
|
|
|
569 | (1) |
|
|
|
569 | (1) |
|
|
|
570 | (1) |
|
|
|
570 | (3) |
|
System Administration Issues |
|
|
573 | (2) |
|
|
|
573 | (1) |
|
|
|
573 | (1) |
|
|
|
573 | (1) |
|
|
|
574 | (1) |
|
|
|
574 | (1) |
|
|
|
574 | (1) |
|
|
|
575 | (4) |
|
|
|
575 | (1) |
|
|
|
575 | (3) |
|
Conflicts with Projects and Nib Files |
|
|
578 | (1) |
|
|
|
578 | (1) |
|
.svn Directory in Built Applications with Xcode 1.5 and Earlier |
|
|
579 | (1) |
|
|
|
579 | (2) |
|
|
|
581 | (40) |
|
End to Free Performance is Nigh! |
|
|
581 | (1) |
|
Approaches To Performance |
|
|
582 | (1) |
|
Major Causes of Performance Problems |
|
|
582 | (7) |
|
|
|
583 | (1) |
|
|
|
583 | (2) |
|
|
|
585 | (1) |
|
|
|
586 | (1) |
|
|
|
587 | (1) |
|
|
|
587 | (1) |
|
|
|
588 | (1) |
|
Before using any of the profiling tools |
|
|
589 | (1) |
|
|
|
589 | (5) |
|
|
|
590 | (1) |
|
|
|
590 | (1) |
|
|
|
591 | (2) |
|
|
|
593 | (1) |
|
|
|
593 | (1) |
|
|
|
593 | (1) |
|
Precise Timing with mach_absolute_time() |
|
|
594 | (2) |
|
|
|
596 | (3) |
|
|
|
596 | (2) |
|
|
|
598 | (1) |
|
|
|
599 | (19) |
|
|
|
599 | (1) |
|
|
|
599 | (1) |
|
|
|
600 | (2) |
|
|
|
602 | (2) |
|
|
|
604 | (2) |
|
|
|
606 | (2) |
|
|
|
608 | (3) |
|
|
|
611 | (3) |
|
|
|
614 | (4) |
|
Using the CHUD Frameworks |
|
|
618 | (1) |
|
|
|
618 | (3) |
| Index |
|
621 | |