Possible Duplicate:
why does initializing subclasses require calling the super class's same init function?
I really can’t understand the role of super in initializing an object.
For example, having this (example — not written by me) code:
@implementation MyObject
- (id) init
{
if([super init]){
return self;
} else {
return nil;
}
}
@end
What [super init] actually does? I’m confused, can’t get the point
It is necessary to ensure correct initialisation of inherited instance variables from the super class of
MyObject.