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. Welcome to Objective-C > Constructing Objects

3.14. Constructing Objects

You might have expected me to explain the syntax for instantiating objects much earlier in this chapter, instead of making you wade through instance variables, explanations about the self variable, and class methods. The reason I didn't is simple: there is no syntax for instantiating objects.

True to its minimalist philosopy, Objective-C lets the class designer decide how objects are created and initialized. In the Cocoa framework, that's through a combination of a factory class method and some conventions for writing initializer (constructor) methods.


  

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