ios 子类继承父类必须实现父类的某个方法?这个怎么去实现?
@interface ClassA : NSObject
- (void)method;
@end
@implementation ClassA
- (void)method{
NSLog("ClassA method");
}
@end
@interface ClassB : ClassA
@end
@implementation ClassB
- (void)method{
//[super methodA];
NSLog("ClassB method");
}
@end
你是想提醒自己必须去重写某个方法,免得忘记?
我用的是在该方法里加宏