As Wayne said in his answer, you have direct access to your superclass members (if they are not private).
And there is no problem calling self.property in the init method if your init looks like this
-(id)initAndTheNameYoWantAndMaybeSomeParameters:(NSString *)paramExample { self = [super initNameOfAnInitMethodFromSuperClass]; //check if the init was with success if(self != nil) { self.myStringProp = paramExample; //or self.propertyFromSuper = paramExample; } }
Yes, you can also do stupid things in initMethods (I did this before :))), like calling the same initMethod from the inside, which generated a recursive call that crashed my application. (Easy to identify this problem)
danypata May 18 '13 at 10:08 2013-05-18 10:08
source share