您的位置:首页 > 移动开发 > Cocos引擎

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

2011-11-30 20:37 519 查看
作为一个新手,运行他人的程序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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  struct google build