I have a method which is implemented in its super method. And when I run my program. It works fine. How do I suppress this warning? By the way, both methods are in ‘.m’ file.
The code is like this:
ClassA.m
@interface ClassA()
- (void)method;
@end
ClassA.h
@interface ClassA : ClassB
@end
ClassB.m
@interface ClassB()
@end
@implementation ClassB
- (void)method
{
}
And it works OK when I call method in ClassA
You’ve got it completly wrong. Popular construction is to have:
ClassB.h
ClassB.m
ClassA.h
ClassA.m
And that’s called method overriding. But if I correctly understand what you are trying to achieve you should have:
ClassB.h
ClassB.m
ClassA.h
And there is no need to mess up with ClassA, and you can call
Then the
methodis available in classA thanks to inheritance from ClassB.