2011年7月7日 星期四

CCLayer CCFadeOut unrecognized selector sent to instance !!~~~~

//目前使用的是 cocos2d 2.0 rc2 版
//
//在CCLayer 淡出效果時
[self runAction:[CCFadeOut actionWithDuration:0.8f]];
//會出現
[classXX setOpacity:]: unrecognized selector sent to instance 0xXXXXXXX !!

似呼有被回呼某 selector
所以必順實做 setOpacity 讓他變更

// Set the opacity of all of our children that support it
-(void) setOpacity: (GLubyte) opacity
{
for( CCNode *node in [self children] )
{
if( [node conformsToProtocol:@protocol( CCRGBAProtocol)] )
{
[(id) node setOpacity: opacity];
}
}
}

沒有留言:

張貼留言