is it possible to override a method as a category method ?
@implementation CCSprite (Utilities)
-(void)draw //its already a member of CCSprite but I wantto override it. but within a category
{
[super draw];
[self doSomethingExtra];
}
@end
purpose: preventing to copy-paste same codeblock for each drived CCMySprite class.thinking Just import and use.
No, this isn’t suggested by Apple, it’s undefined behavior if you do that. One of the two methods will be used in this case, and you can’t know which one.