so far, we've created new objects in two different ways. The first way is
[SomeClass new], and the second is
[[SomeClass alloc] init]. These two techniques are equivalent, but the common Cocoa convention is to use
init rather than
new. Typically, Cocoa programmers use
new as training wheels until they have enough background to be comfortable with
init. It's time for your training wheels to come off.
Allocation is the process by which a new object is born. It's the happy time when a chunk of memory is obtained from the operating system and designated as the location that will hold the object's instance variables. Sending the
alloc message to a class causes that class to allocate ...