是否可以将方法重写为类别方法?
@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
目的:防止为每个驱动的 CCMySprite 类复制粘贴相同的代码块。thinking 只需导入和使用。