Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
The Two-Stage Creation pattern is used extensively by Cocoa, and you must adhere to it if you subclass any Cocoa classes. You must be aware of which initializer is the Designated Initializer to create a properly working subclass. Table 3.1 lists several prominent Cocoa classes that are frequently subclassed and identifies the Designated Initializers.
| Class | Designated Initializer |
|---|---|
| NSObject | -init |
| NSView | -initWithFrame: |
| NSCell | -initImageCell: and -initTextCell: |
| NSControl | -initWithFrame: |
| NSDocument | -init |
| NSWindowController | -initWithWindow: |