今天遇到了如下的一个错误,
Sending 'ccColor4B' (aka 'struct_ccColor4B') to parameter of incompatible type CiColor
网上搜寻解决方案如下,就是要强制设置下类型。
按如下改变:
+ (id) layerWithColor:(ccColor4B)color
{
return [[(CCColorLayer*)[self alloc] initWithColor:color] autorelease];
//return [[[self alloc] initWithColor:color] autorelease];
}
Sending 'ccColor4B' (aka 'struct_ccColor4B') to parameter of incompatible type CiColor
网上搜寻解决方案如下,就是要强制设置下类型。
按如下改变:
+ (id) layerWithColor:(ccColor4B)color
{
return [[(CCColorLayer*)[self alloc] initWithColor:color] autorelease];
//return [[[self alloc] initWithColor:color] autorelease];
}
本文提供了解决发送ccColor4B类型到不兼容参数类型的方案,通过强制设置类型来修复错误。具体操作包括使用特定的初始化方式创建CCColorLayer实例,并在释放时使用autorelease。此解决方案适用于遇到类型转换错误的情况。
2721

被折叠的 条评论
为什么被折叠?



