Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 3. Two-Stage Creation > Examples in Cocoa

Examples in Cocoa

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.

Table 3.1. Prominent Cocoa Classes and Their Designated Initializers
ClassDesignated Initializer
NSObject-init
NSView-initWithFrame:
NSCell-initImageCell: and -initTextCell:
NSControl-initWithFrame:
NSDocument-init
NSWindowController-initWithWindow:



  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint