2

Using cocos2d-1.0.1

Have

    [sprite runAction:[CCRotateBy actionWithDuration:10.0 angle:360]];

Your sprite rotates all nicely. Works fine on all devices and iOS versions.

... except iPhone 5S and iPad Air. If you do the above code, the rotation is super glitchy.

The only thing in common I see in those devices is the fact that they have some new processor thing.

What do I do? Any Rotate action is messed up on those devices.

Saturn
  • 17,888
  • 49
  • 145
  • 271

1 Answers1

10

I fixed it!

I digged into the implementation of CCRotateBy and CCRotateTo. Their update methods are like

-(void) update: (ccTime) t
{   
    [target_ setRotation: (startAngle_ +angle_ * t )];
}

But Xcode warns you that target_ has multiple implementations of setRotation. If you cast it to CCNode it works!

-(void) update: (ccTime) t
{   
    [(CCNode*)target_ setRotation: (startAngle_ +angle_ * t )];
}

I don't know why does this problem manifest only on those devices, though.

Saturn
  • 17,888
  • 49
  • 145
  • 271
  • a good solution, thank you. Have you got any troubles with audio, especially resuming audio? On the iPad Air background music doesn't resumed but on others devices all fine. I'm using SimpleAudioEngine – Kate Geld Jun 03 '15 at 10:15
  • the issue was that need to been changed [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryRecord error:nil]; to [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord error:nil]; – Kate Geld Jun 15 '15 at 07:08