self
is already assigned for you. The purpose of assigning it to [super init]
is to allow the superclass's -init
implementation to return a different object. I highly recommend The How and Why of Cocoa Initializers (Mike Ash) and self = [stupid init]; (Wil Shipley) for more detailed discussion about why this is (or isn't) a good idea. You will find varying opinions on whether checking equality (==
) is necessary.
As an aside, if you try to assign to self
in any other method, you see this error message: