Accessing properties in init
or dealloc
can be problematic if the property
accessor methods make assumptions about the state of the object, which might not be
fulfilled in a partially constructed object.
But this applies only to the properties of the class itself, not to the properties of the superclass. After
self = [super init];
the "super-part" of self
is fully constructed, therefore it is safe to call
self.whatever = 100;
in the subclass init method, to set a property declared in the superclass.
_whatever = 100;
does not work in the subclass because the automatically synthesized instance variable is visible only in the superclass itself. You could declare it explicitly to make it visible to the subclass, but there is no need to do so.