|
I: One Pattern to Rule Them All |
|
|
1 | (27) |
|
|
2 | (15) |
|
|
4 | (11) |
|
Core Data Support for Model Subsystems |
|
|
5 | (1) |
|
Application Kit Support for View Subsystems |
|
|
6 | (2) |
|
Application Kit Support for Controller Subsystems |
|
|
8 | (1) |
|
Cocoa's Text Architecture |
|
|
9 | (1) |
|
Cocoa's Document Architecture |
|
|
10 | (3) |
|
|
13 | (1) |
|
Cocoa's Preference Pane Architecture |
|
|
14 | (1) |
|
Quartz Composer's Architecture |
|
|
15 | (1) |
|
|
15 | (1) |
|
|
15 | (2) |
|
|
17 | (11) |
|
|
17 | (5) |
|
Analysis of the Non-MVC Pay Calculator Design |
|
|
21 | (1) |
|
|
22 | (5) |
|
Analysis of the MVC Pay Calculator Design |
|
|
26 | (1) |
|
|
27 | (1) |
|
|
28 | (119) |
|
|
29 | (14) |
|
|
29 | (2) |
|
|
31 | (7) |
|
|
31 | (1) |
|
Initializing Allocated Memory |
|
|
32 | (1) |
|
Implementing the Designated Initializer |
|
|
33 | (2) |
|
Using Zones in Initializers |
|
|
35 | (2) |
|
Creating Temporary Instances |
|
|
37 | (1) |
|
|
38 | (4) |
|
|
42 | (1) |
|
|
43 | (10) |
|
|
43 | (1) |
|
|
44 | (3) |
|
|
45 | (1) |
|
Designing with Template Methods |
|
|
46 | (1) |
|
|
47 | (4) |
|
Using the -drawRect: Template Method |
|
|
47 | (1) |
|
Other Cocoa Template Methods |
|
|
47 | (4) |
|
|
51 | (2) |
|
|
53 | (10) |
|
|
53 | (1) |
|
|
53 | (8) |
|
|
54 | (6) |
|
Dynamic Creation to Implement Plug-In Architectures |
|
|
60 | (1) |
|
|
61 | (1) |
|
|
62 | (1) |
|
|
63 | (14) |
|
|
63 | (1) |
|
|
64 | (6) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (1) |
|
When to Use Categories Versus Subclassing |
|
|
69 | (1) |
|
|
70 | (4) |
|
Using Categories for Organization |
|
|
70 | (1) |
|
Using Categories for Informal Protocols |
|
|
71 | (3) |
|
Using Categories for Framework Division |
|
|
74 | (1) |
|
|
74 | (3) |
|
|
74 | (1) |
|
|
75 | (1) |
|
|
76 | (1) |
|
Anonymous Type and Heterogeneous Contalners |
|
|
77 | (8) |
|
|
77 | (1) |
|
|
77 | (7) |
|
|
78 | (3) |
|
|
81 | (2) |
|
|
83 | (1) |
|
|
84 | (1) |
|
|
84 | (1) |
|
|
85 | (14) |
|
|
85 | (1) |
|
|
85 | (12) |
|
|
86 | (1) |
|
|
87 | (1) |
|
Creating Custom Enumerators |
|
|
87 | (5) |
|
Implementing Fast Enumeration |
|
|
92 | (4) |
|
|
96 | (1) |
|
|
97 | (1) |
|
|
97 | (2) |
|
Perform Selector and Delayed Perform |
|
|
99 | (8) |
|
|
100 | (1) |
|
|
100 | (4) |
|
|
102 | (1) |
|
The Implementation of Objective-C Message Sending |
|
|
102 | (2) |
|
|
104 | (2) |
|
|
106 | (1) |
|
|
107 | (16) |
|
|
108 | (1) |
|
|
108 | (11) |
|
Reference Counted Memory Management |
|
|
110 | (1) |
|
Accessors That Manage Retain Counts |
|
|
111 | (3) |
|
Confining Memory Management to Accessors |
|
|
114 | (1) |
|
|
115 | (2) |
|
|
117 | (1) |
|
Interface Builder Outlets |
|
|
118 | (1) |
|
Objective-C 2.0 Properties |
|
|
118 | (1) |
|
|
119 | (3) |
|
|
122 | (1) |
|
Archiving and Unarchiving |
|
|
123 | (12) |
|
|
123 | (1) |
|
|
124 | (3) |
|
|
125 | (2) |
|
|
127 | (7) |
|
Implementing the NSCoding Protocol |
|
|
128 | (3) |
|
Encoding and Decoding Nonobject Types |
|
|
131 | (2) |
|
|
133 | (1) |
|
|
133 | (1) |
|
|
134 | (1) |
|
|
135 | (12) |
|
|
135 | (3) |
|
|
138 | (1) |
|
|
139 | (7) |
|
|
140 | (1) |
|
Implementing Deep Copying |
|
|
141 | (1) |
|
Implementing NSMutable Copying |
|
|
142 | (1) |
|
|
143 | (1) |
|
Copying Objective-C 2.0 Properties |
|
|
144 | (2) |
|
|
146 | (1) |
|
|
146 | (1) |
|
III: Patterns That Primarily Empower by Decoupling |
|
|
147 | (127) |
|
|
148 | (11) |
|
|
148 | (1) |
|
|
148 | (9) |
|
Encapsulating a Shared Resource |
|
|
149 | (1) |
|
Creating and Accessing a Shared Instance |
|
|
150 | (3) |
|
Controlling Instantiation |
|
|
153 | (2) |
|
|
155 | (1) |
|
Determining if the Singleton Has Been Created |
|
|
155 | (1) |
|
|
156 | (1) |
|
Working with Interface Builder |
|
|
156 | (1) |
|
|
157 | (1) |
|
|
158 | (1) |
|
|
159 | (16) |
|
|
160 | (1) |
|
|
160 | (8) |
|
|
160 | (2) |
|
|
162 | (5) |
|
|
167 | (1) |
|
|
168 | (4) |
|
Global Notification Names |
|
|
168 | (1) |
|
``Will'' and ``Did'' Notifications |
|
|
169 | (1) |
|
Synchronous Versus Asynchronous Notifications |
|
|
169 | (2) |
|
Distributed Notifications |
|
|
171 | (1) |
|
|
172 | (3) |
|
|
175 | (16) |
|
|
175 | (4) |
|
|
179 | (10) |
|
Implementing Delegate Support |
|
|
180 | (6) |
|
|
186 | (2) |
|
|
188 | (1) |
|
|
189 | (1) |
|
|
189 | (2) |
|
|
191 | (15) |
|
|
191 | (1) |
|
|
191 | (14) |
|
|
192 | (3) |
|
|
195 | (2) |
|
Coordinate Systems in the View Hierarchy |
|
|
197 | (1) |
|
Browsing the View Hierarchy |
|
|
197 | (8) |
|
|
205 | (1) |
|
|
205 | (1) |
|
Outlets, Targets, and Actions |
|
|
206 | (14) |
|
|
207 | (1) |
|
|
207 | (8) |
|
|
211 | (1) |
|
|
211 | (1) |
|
|
212 | (1) |
|
Actions and Responder Chains |
|
|
213 | (2) |
|
|
215 | (3) |
|
|
218 | (2) |
|
|
220 | (12) |
|
|
220 | (1) |
|
|
220 | (10) |
|
|
221 | (1) |
|
|
221 | (2) |
|
The Extended Responder Chain |
|
|
223 | (2) |
|
Walking Through the Extended Responder Chain |
|
|
225 | (2) |
|
Inserting Objects into the Responder Chain |
|
|
227 | (1) |
|
Leveraging the Responder Chain |
|
|
228 | (2) |
|
|
230 | (1) |
|
|
231 | (1) |
|
|
232 | (10) |
|
|
232 | (1) |
|
|
232 | (4) |
|
Simulating Instance Variables |
|
|
233 | (3) |
|
|
236 | (4) |
|
Reference Counted Memory Management |
|
|
237 | (2) |
|
|
239 | (1) |
|
|
240 | (2) |
|
|
242 | (13) |
|
|
242 | (1) |
|
|
242 | (12) |
|
|
243 | (1) |
|
Using NSInvocation Objects |
|
|
244 | (4) |
|
|
248 | (5) |
|
|
253 | (1) |
|
|
254 | (1) |
|
|
254 | (1) |
|
|
255 | (8) |
|
|
255 | (1) |
|
|
255 | (2) |
|
|
257 | (5) |
|
Using MYLabeledBarCell Instances as Prototypes |
|
|
258 | (2) |
|
Using MYColorLabeledBarCell Instances as Prototypes |
|
|
260 | (2) |
|
|
262 | (1) |
|
|
263 | (5) |
|
|
263 | (1) |
|
|
263 | (1) |
|
|
264 | (3) |
|
Encapsulating Nonobject Values |
|
|
264 | (1) |
|
Reducing Storage Requirements |
|
|
265 | (1) |
|
Standing in for Other Objects |
|
|
266 | (1) |
|
|
267 | (1) |
|
|
268 | (6) |
|
|
268 | (2) |
|
|
270 | (1) |
|
|
271 | (2) |
|
|
272 | (1) |
|
|
273 | (1) |
|
IV: Patterns That Primarily Hide Complexity |
|
|
274 | (90) |
|
|
275 | (7) |
|
|
275 | (1) |
|
|
276 | (2) |
|
|
278 | (3) |
|
Dynamically Loading Executable Code |
|
|
279 | (2) |
|
|
281 | (1) |
|
|
282 | (20) |
|
|
283 | (1) |
|
|
283 | (5) |
|
|
285 | (3) |
|
|
288 | (12) |
|
Subclassing a Class Cluster's Public Interface Class |
|
|
288 | (1) |
|
The MYShortString Subclass of NSString |
|
|
289 | (11) |
|
Lessons from MYShorString |
|
|
300 | (1) |
|
|
300 | (2) |
|
|
302 | (10) |
|
|
303 | (1) |
|
|
303 | (4) |
|
|
307 | (4) |
|
|
307 | (1) |
|
|
308 | (1) |
|
The Persistent Storage Facade |
|
|
309 | (1) |
|
|
309 | (2) |
|
|
311 | (1) |
|
|
312 | (16) |
|
|
312 | (1) |
|
|
312 | (15) |
|
|
313 | (1) |
|
|
314 | (7) |
|
|
321 | (6) |
|
|
327 | (1) |
|
|
327 | (1) |
|
|
328 | (9) |
|
|
328 | (1) |
|
|
328 | (7) |
|
Extending the Singleton Pattern |
|
|
330 | (3) |
|
Adding Other Manager Features |
|
|
333 | (2) |
|
|
335 | (1) |
|
|
336 | (1) |
|
|
337 | (27) |
|
|
338 | (1) |
|
|
338 | (22) |
|
MYShapeDraw Model Subsystem |
|
|
339 | (1) |
|
MYShapeDraw View Subsystem |
|
|
340 | (2) |
|
MYShapeEditor Controller Subsystem |
|
|
342 | (11) |
|
Extending the MYShapeDraw View Subsystem for Editing |
|
|
353 | (2) |
|
Redesigning and Generalizing the Solution |
|
|
355 | (5) |
|
|
360 | (2) |
|
|
361 | (1) |
|
|
362 | (2) |
|
V: Practical Tools for Pattern Application |
|
|
364 | (40) |
|
|
365 | (14) |
|
The Role of the Model Subsystem |
|
|
366 | (1) |
|
|
366 | (2) |
|
|
367 | (1) |
|
|
367 | (1) |
|
|
367 | (1) |
|
|
368 | (1) |
|
Collaboration of Patterns Within Core Data |
|
|
368 | (9) |
|
NSManagedObject and NSEntityDescription |
|
|
369 | (6) |
|
Designing Core Data Models |
|
|
375 | (1) |
|
|
375 | (1) |
|
NSPersistentStore Coordinator and NSPersistent Store |
|
|
376 | (1) |
|
Core Data Limitations and Benefits |
|
|
377 | (2) |
|
|
379 | (14) |
|
The Role of the View Subsystem |
|
|
379 | (1) |
|
Collaboration of Patterns Within Application Kit |
|
|
380 | (12) |
|
NSApplication, Events, and the Run Loop |
|
|
381 | (1) |
|
|
381 | (1) |
|
|
382 | (1) |
|
|
383 | (2) |
|
|
385 | (2) |
|
|
387 | (1) |
|
Archived Objects and Nibs |
|
|
388 | (3) |
|
|
391 | (1) |
|
|
391 | (1) |
|
Application Kit Limitations and Benefits |
|
|
392 | (1) |
|
|
393 | (11) |
|
Role of Bindings and Controllers |
|
|
393 | (4) |
|
|
395 | (1) |
|
The Importance of Using Controllers with Bindings |
|
|
396 | (1) |
|
Collaboration of Patterns Within Bindings and Controllers |
|
|
397 | (5) |
|
What Happens in -bind:toObject:withKeyPath:options:? |
|
|
399 | (1) |
|
How Does Key Value Observing Detect Changes to Observed Properties so That Observing Objects Can Be Notified? |
|
|
399 | (1) |
|
What Message Is Sent to Notify Registered Observers When an Observed Property's Value is Changed? |
|
|
400 | (2) |
|
Bindings and Controllers Limitations and Benefits |
|
|
402 | (2) |
|
|
404 | (3) |
|
|
404 | (1) |
|
|
405 | (1) |
|
|
405 | (1) |
|
|
406 | (1) |
|
|
406 | (1) |
|
|
406 | (1) |
Index |
|
407 | |