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

作为一个新手,运行他人的程序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];
}
posted @ 2012-05-19 10:45  高笑228  阅读(206)  评论(0编辑  收藏  举报