Skip to content

Instantly share code, notes, and snippets.

@congpc
Created December 14, 2015 09:47
Generalization
#import <Foundation/Foundation.h>
@interface ObjCGeneralization_ClassA : NSObject
- (void)doAction;
@end
@implementation ObjCGeneralization_ClassA
- (void)doAction {
NSLog(@"Do action A");
}
@end
#import "ObjCGeneralization_ClassA.h"
@interface ObjCGeneralization_ClassB : ObjCGeneralization_ClassA
@end
@implementation ObjCGeneralization_ClassB
- (void)doAction {
[super doAction];
NSLog(@"Do action B");
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment