Introduction to OOP: Chapter 4: Messages, Instances, and Initialization: [next] [previous] [audio] [real] [text]

Class Methods

In Smalltalk and Objective-C behavior can be associated with an ``object creator'' for the class. This behavior is not part of the actions used by instances of the class. This behavior will then ensure that objects are property initialized when created.

id aCard;

aCard = [ Card rank: 2 suit: 3 ];
Intro OOP, Chapter 4, Slide 11