Introduction |
|
xiv | |
|
1 The Objective-C Philosophy |
|
|
1 | (18) |
|
Understanding the Object Model |
|
|
2 | (2) |
|
A Tale of Two Type Systems |
|
|
4 | (1) |
|
|
5 | (2) |
|
The Language and the Library |
|
|
7 | (2) |
|
The History of Objective-C |
|
|
9 | (4) |
|
|
13 | (2) |
|
Compiling Objective-C Programs |
|
|
15 | (4) |
|
|
19 | (44) |
|
Declaring Objective-C Types |
|
|
20 | (4) |
|
|
24 | (4) |
|
|
28 | (3) |
|
|
31 | (5) |
|
|
36 | (2) |
|
Adding Methods to a Class |
|
|
38 | (4) |
|
|
42 | (1) |
|
Synthesizing Methods with Declared Properties |
|
|
43 | (6) |
|
Understanding self, _cmd, super |
|
|
49 | (3) |
|
Understanding the isa Pointer |
|
|
52 | (3) |
|
|
55 | (3) |
|
|
58 | (2) |
|
|
60 | (3) |
|
|
63 | (32) |
|
|
64 | (2) |
|
Assigning to Instance Variables |
|
|
66 | (1) |
|
Automatic Reference Counting |
|
|
67 | (3) |
|
Returning Objects via Pointer Arguments |
|
|
70 | (3) |
|
|
73 | (2) |
|
|
75 | (3) |
|
|
78 | (3) |
|
Using Autoreleased Constructors |
|
|
81 | (1) |
|
Autoreleasing Objects in Accessors |
|
|
82 | (1) |
|
Supporting Automatic Garbage Collection |
|
|
83 | (2) |
|
|
85 | (3) |
|
Understanding Object Destruction |
|
|
88 | (2) |
|
|
90 | (3) |
|
Allocating Scanned Memory |
|
|
93 | (2) |
|
4 Common Objective-C Patterns |
|
|
95 | (24) |
|
Supporting Two-Stage Creation |
|
|
96 | (2) |
|
|
98 | (2) |
|
|
100 | (4) |
|
Creating Designated Initalizers |
|
|
104 | (3) |
|
Enforcing the Singleton Pattern |
|
|
107 | (2) |
|
|
109 | (2) |
|
|
111 | (2) |
|
|
113 | (3) |
|
|
116 | (3) |
|
|
119 | (14) |
|
Storing Numbers in Collections |
|
|
121 | (4) |
|
Performing Decimal Arithmetic |
|
|
125 | (3) |
|
Converting Between Strings and Numbers |
|
|
128 | (2) |
|
Reading Numbers from Strings |
|
|
130 | (3) |
|
|
133 | (26) |
|
Creating Constant Strings |
|
|
134 | (1) |
|
|
135 | (4) |
|
Processing a String One Character at a Time |
|
|
139 | (3) |
|
Converting String Encodings |
|
|
142 | (3) |
|
|
145 | (1) |
|
|
146 | (2) |
|
|
148 | (2) |
|
Creating Strings from Templates |
|
|
150 | (4) |
|
Matching Patterns in Strings |
|
|
154 | (2) |
|
|
156 | (3) |
|
7 Working with Collections |
|
|
159 | (24) |
|
|
161 | (2) |
|
|
163 | (2) |
|
Storing Unordered Groups of Objects |
|
|
165 | (2) |
|
|
167 | (2) |
|
Iterating Over a Collection |
|
|
169 | (4) |
|
Finding an Object in a Collection |
|
|
173 | (3) |
|
|
176 | (3) |
|
Storing Objects in C++ Collections |
|
|
179 | (4) |
|
|
183 | (12) |
|
|
184 | (2) |
|
Converting Dates for Display |
|
|
186 | (3) |
|
|
189 | (2) |
|
Parsing Dates from Strings |
|
|
191 | (1) |
|
|
192 | (3) |
|
9 Working with Property Lists |
|
|
195 | (18) |
|
Storing Collections in Property Lists |
|
|
196 | (3) |
|
Reading Data from Property Lists |
|
|
199 | (3) |
|
Converting Property List Formats |
|
|
202 | (2) |
|
|
204 | (2) |
|
|
206 | (4) |
|
Storing Arbitrary Objects in User Defaults |
|
|
210 | (3) |
|
10 Interacting with the Environment |
|
|
213 | (10) |
|
Getting Environment Variables |
|
|
214 | (2) |
|
Parsing Command-Line Arguments |
|
|
216 | (2) |
|
Accessing the User's Locale |
|
|
218 | (1) |
|
Supporting Sudden Termination |
|
|
219 | (4) |
|
|
223 | (14) |
|
|
224 | (1) |
|
|
225 | (4) |
|
|
229 | (2) |
|
|
231 | (2) |
|
|
233 | (4) |
|
|
237 | (18) |
|
Runtime Differences for Exceptions |
|
|
238 | (4) |
|
Throwing and Catching Exceptions |
|
|
242 | (2) |
|
|
244 | (2) |
|
Using the Unified Exception Model |
|
|
246 | (1) |
|
Managing Memory with Exceptions |
|
|
247 | (3) |
|
|
250 | (2) |
|
|
252 | (1) |
|
|
253 | (2) |
|
13 Accessing Directories and Files |
|
|
255 | (18) |
|
|
256 | (2) |
|
|
258 | (2) |
|
|
260 | (2) |
|
|
262 | (2) |
|
Determining if a File or Directory Exists |
|
|
264 | (2) |
|
|
266 | (3) |
|
Finding Files in Svstem Locations |
|
|
269 | (4) |
|
|
273 | (14) |
|
|
274 | (1) |
|
Controlling Thread Priority |
|
|
275 | (3) |
|
|
278 | (2) |
|
Storing Thread-Specific Data |
|
|
280 | (3) |
|
|
283 | (4) |
|
15 Blocks and Grand Central |
|
|
287 | (14) |
|
Binding Variables to Blocks |
|
|
288 | (5) |
|
Managing Memory with Blocks |
|
|
293 | (3) |
|
Performing Actions in the Background |
|
|
296 | (2) |
|
Creating Custom Work Queues |
|
|
298 | (3) |
|
|
301 | (10) |
|
|
302 | (2) |
|
|
304 | (1) |
|
|
305 | (2) |
|
Sending Notifications Between Applications |
|
|
307 | (4) |
|
|
311 | (16) |
|
|
312 | (2) |
|
|
314 | (3) |
|
Sharing Objects Over a Network |
|
|
317 | (3) |
|
|
320 | (3) |
|
|
323 | (4) |
|
|
327 | (12) |
|
|
328 | (2) |
|
Recognizing Memory Problems |
|
|
330 | (3) |
|
|
333 | (2) |
|
|
335 | (2) |
|
|
337 | (2) |
|
19 The Objective-C Runtime |
|
|
339 | (20) |
|
|
340 | (2) |
|
|
342 | (1) |
|
Testing If an Object Understands a Method |
|
|
343 | (3) |
|
|
346 | (3) |
|
|
349 | (2) |
|
|
351 | (2) |
|
|
353 | (3) |
|
Adding New Instance Variables |
|
|
356 | (3) |
Index |
|
359 | |