In some cases, self = [self init] is called in init method instead of [super init] in the code I reviewed. Do you think that kind of syntax is acceptable or it is the sign that logic arranged in some ways wrong (the wrong patterns) if it is lead to the use of [self init]?
For instance (it could be another example),
- (instancetype)init {
self = [super init];
//my code block
return self;
}
- (instancetype)initWithDelegate:(id<MyDelegate>)delegate {
self = [self init]; //self = [super init] is not called since "my code block" needs to be implemented
if (self) {
self.delegate = delegate;
}
return self;
}
Can it be the case when self = [self init] is ok? If yes, do you have any example?