0

I have a game which is made in SpriteKit. I have made it based on the 7.1 SDK, but now I have to make it work on 7.0 as well. So everything is OK, except that one of my completion blocks does not run on 7.0. Here is the code:

[self.strechableArmSprite runAction:[SKAction rotateToAngle:0 duration:0] completion:^{
                [self.warriorPhysicalHand removeFromParent];
                [self.warriorHand removeFromParent];
                [self runAction:self.slapReverseAction completion:^{
                    completionBlock();
                }];
}];

The slapReverseAction action is a simple animation:

sumoWarrior.slapReverseAction = [SKAction runBlock:^{
    [sumoWarrior runAction:sumoWarrior.slapReverseSumoAction];
    [sumoWarrior.strechableArmSprite removeFromParent];
}];

Any ideas why the completionBlock() is not getting called on iOS 7.0?

tshepang
  • 12,111
  • 21
  • 91
  • 136
damjandd
  • 708
  • 2
  • 9
  • 24
  • Which block isn't running? The runBlock or the completionBlock() in the 1st code fragment or the runBlock in the 2nd code fragment? Could it be that you are removing the node that is running the action? In any case you perform the removeFromParent from within the block. – CodeSmile Jul 05 '14 at 19:39
  • The completionBlock() in the 1st code fragment is not running. What confuses me is that it worked on iOS 7.1, and there is nothing in the changelog for Sprite Kit saying that blocks and actions perform differently on iOS 7.1. – damjandd Jul 06 '14 at 11:27

0 Answers0