Hi, just stated learning cocos2d and found an issue I can't resolve.
I'm creating a MultiplexLayer with some layers in it, each layer calls a method to do a CCFadeIn on init, everything fine here.
Next I save a reference to those layers into a NSMutable Array so I can call a custom method on each layer after switching to it
So far so good, a NSLog trace inside the method shows it gets called correctly but CCFadeIn won't run a second time
.h code:
@interface layer1 : CCLayer {
CCSprite *pic;
}
//
-(void) fadeLayer;
@end
.m code:
- (id) init{
if( (self=[super init] )) {
pic = [CCSprite spriteWithFile:@"layer1.png"];
pic.position = ccp(0,0);
[self addChild:pic];
[self fadeLayer];
NSLog(@"init layer 1");
}
return self;
}
- (void)fadeLayer {
//everything runs ok on init, only NSLog works on next calls
NSLog(@"fade in Layer 1");
[pic setOpacity:0];
[pic runAction: [CCFadeIn actionWithDuration:1.5]];
}
Any help is appreciated.