In order to use an instance of a class (an object), you must have a variable that points to the object. A pointer variable stores the location of an object in memory, not the object itself. (It “points to” the object.) A variable that points to an object is declared like so:
This variable is named partyInstance. It is meant to be a pointer to an instance of the class Party. However, this does not create a Party instance – only a variable that can point to a Party object.
An object has a life span: it is created, sent messages, and then destroyed when it is no longer needed.
To create an object, you send an alloc message to a class. In response, the class creates an ...