I have a simple CCRotateBy action in a sequence; it is followed by a call to another method which confirms that the CCRotateBy completed (otherwise, that CCCallFunc would not get called in the sequence if CCRotateBy didn’t complete):
-(void)correctRotation{
if (self.rotationAmount){
CCLOG(@"correcting rotation inside: %i",self.buildNum);
CCRotateBy*second=[CCRotateBy actionWithDuration:1 angle:-self.rotationAmount];
CCEaseBackInOut*bounce2=[CCEaseBackInOut actionWithAction:second];
CCCallFunc*func=[CCCallFunc actionWithTarget:self selector:@selector(stabilize)];
CCSequence*seq=[CCSequence actions:bounce2,func, nil];
[self runAction:seq];
}
}
-(void)stabilize{
CCLOG(@"stabilize before rotation: %i for %i",self.rotationAmount,self.buildNum);
self.rotationAmount=0;
CCLOG(@"stabilize after rotation: %i for %i",self.rotationAmount,self.buildNum);
}
The CCLog statements are confirming that the rotation should be happening, and that the angle of the rotation is not nil (it is always an integer). These logs also show that the CCSequence is completing. However, the sprite is not rotating on the screen. I’ve been pouring over this code for hours trying to figure out what could be going wrong. If the sprite’s actions were being stopped, then these 3 log statements would not complete, right?
As @tassinari says try removing the bounce function.
This is from the cocos2d api reference
http://www.cocos2d-iphone.org/api-ref/1.1.0/interface_c_c_ease_back_in_out.html