The following is commonplace in Objective-C.
- (id)init {
if (self = [super init]) {
// custom initialization
}
return self;
}
Because -init
is an instance method, it must be called on a valid instance of a class, and an instance of a class must be instantiated. This instantiation uses up memory. Does calling -init
on super
use memory as it has to instantiate a new object to call the init
method on?