关于代码层面Category技巧
2017-04-18 本文已影响33人
践行者
<pre>
@interface A : NSObject
@end
@interface A (Extention)
-(void)test;
@end
</pre>
<pre>
@implementation A
-(void)test{
NSLog(@"A");
}
@end
@implementation A (Extention)
-(void)test{
NSLog(@"A Extention");
}
@end
</pre>
<pre>
@interface B : A
@end
@implementation B
-(void)test{
NSLog(@"B");
[super test];
}
@end
</pre>