Created
July 13, 2015 13:16
-
-
Save alladinian/e3aa1d7469828c5d3bd2 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 A : NSObject | |
- (void)test; | |
@end | |
@implementation A | |
- (void)test { | |
NSLog(@"A"); | |
} | |
@end | |
@interface SubA0 : A | |
@end | |
@implementation SubA0 | |
- (void)test { | |
NSLog(@"SubA0"); | |
} | |
@end | |
@interface SubA1 : A | |
@end | |
@implementation SubA1 | |
- (void)test { | |
NSLog(@"SubA1"); | |
} | |
@end | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSDictionary *dic = [[NSDictionary alloc]initWithObjectsAndKeys:[[SubA0 alloc]init], @"SubA0", [[SubA1 alloc]init], @"SubA1", nil]; | |
[[dic objectForKey:@"SubA0"] test]; | |
[[dic objectForKey:@"SubA1"] test]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment