Recent versions of llvm have added an attribute that indicates that subclasses must call super:
@interface Barn:NSObject
- (void)openDoor NS_REQUIRES_SUPER;
@end
@implementation Barn
- (void) openDoor
{
;
}
@end
@interface HorseBarn:Barn
@end
@implementation HorseBarn
- (void) openDoor
{
;
}
@end
Compiling the above produces the warning:
Method possibly missing a [super openDoor] call
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…