I have been struggling to find a correct and explicit answer, so I have decided to ask it here.
I create class A and define init method there:
@interface A : NSObject
- (id)initWithHealth:(int)hp;
@end
Then I am creating class B, that inherits from class A and define another init method there:
@interface B : A
- (id)initWithHealth:(int)hp andDamage:(int)dmg;
@end
In main, when I am going to instantiate an object from class B, I will be suggested by Xcode to use either - (id)initWithHealth:(int)hp; OR - (id)initWithHealth:(int)hp andDamage:(int)dmg; init method. How can I forbid for class B to inherit init method from class A? I want my class B to have only one init method that I define. Is there a way to achieve this?
Thanks in advance.