cocos2d 1.01不能运行以前版本工程的问题

来源:互联网 发布:suffer软件免费下载 编辑:程序博客网 时间:2024/05/17 02:51

作为一个新手,运行他人的程序build时往往会在

+ (id) layerWithColor:(ccColor4B)color{   return [[[self alloc] initWithColor:color] autorelease];    // <- ERROR HERE}

处出现以下报错:

Sending 'ccColor4B' (aka 'struct_ccColor4B') to parameter of incompatible type 'CIColor *'

google了一下,发现问题在这里:

+ (id) layerWithColor:(ccColor4B)color{return [[(CCLayerColor*)[self alloc] initWithColor:color] autorelease];}
调试,换之,仍不能运行,仍报错:

Use of undeclared'CCLayerColor'

忽然想起来新版本的区别,于是改为:

+ (id) layerWithColor:(ccColor4B)color{return [[(CCColorLayer*)[self alloc] initWithColor:color] autorelease];}
参考文献:http://www.cocos2d-iphone.org/forum/topic/21888


原创粉丝点击