摘要: CCSprite的各种initWithXXX方法中都会调用init方法:-(id) initWithXXX { self =[self init];}所以在你的ccsprite子类的init方法中不要调用除[super init]之外的任何initWithXXX方法,否则就会出现递归的执行init的问题。错误代码:-(id) init{ self = [super init]; if (self){ [self initWithFile:@"BlueFish.png"]; //因为此处调用了CCsprite中的initWithFile:方法会重复递归调用init,生成死循环 阅读全文
posted @ 2012-08-14 10:57 hellocby 阅读(1080) 评论(0) 推荐(0) 编辑