Created
July 2, 2015 01:06
-
-
Save jebai0521/4287567d3f567445b0db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
@interface BarA : NSObject | |
//- (void) fun1; | |
//- (void) fun2; | |
@end | |
@implementation BarA | |
- (void) fun2 | |
{ | |
NSLog(@"parent fun2"); | |
} | |
- (void) fun1 | |
{ | |
NSLog(@"aaa"); | |
[self fun2]; | |
} | |
@end | |
@interface BarB : BarA | |
@end | |
@implementation BarB | |
- (void) fun1 | |
{ | |
NSLog(@"bbb"); | |
[self fun2]; | |
} | |
- (void) fun2 | |
{ | |
NSLog(@"children fun2"); | |
} | |
@end | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
BarA* a = [[BarB alloc] init]; | |
[a fun1]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment