关于代码层面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>

上一篇 下一篇

猜你喜欢

热点阅读