I want to do something after delay 3 seconds , so I make the following codes in my Init method of my CCLayerColor
-(id) init
{
if( (self=[super initWithColor:ccc4(255,255,255,255)] )) {
[self runAction:[CCSequence actions:
[CCDelayTime actionWithDuration:3],
[CCCallFunc actionWithTarget:self selector:@selector(myFunction)],
nil]];
}
return self;
}
- (void)myFunction
{
//do something.
}
I can see the init method has been called after set the breakpoint.
but the myFunction will never be called .
What's wrong with my code ?