Please explain this two points


What do these checks do? A few classes have deviant init methods. There are two possible forms of deviance:

[quote]-The init method figures out a clever optimization that it can do, deallocates the original object, allocates a different object, and returns the new object.
To address this possibility, Apple requires that you set self to point to the object returned from the superclass’s initializer.-
-The init method fails, deallocates the object, and returns nil.
To deal with this possibility, Apple recommends that you check that the superclass’s initializer returns a valid object and not nil. After all, there is no point in performing custom set-up on an object that does not exist.[/quote]

What does these two points mean my english is not good please explain.


It all really means that the object returned by our superclass’ -init method may be a different object than the one that we originally set out to initialize. One of the reasons for our use of “self = [super init]” is to keep this from breaking our program, by initializing whatever object our superclass’ -init method returns.