0
if ([contact.bodyA.node.name  isEqualToString:@"growCoins"] || [contact.bodyB.node.name  isEqualToString:@"growCoins"]) {
        [hero grow];
        self.immune = YES;
        [self immuned];
        immunitytobeFading = [NSTimer timerWithTimeInterval:7 target:self selector:@selector(immunityFading) userInfo:nil repeats:NO];
        ////
        NSTimer *immunityFades;
        immunityFades = [NSTimer timerWithTimeInterval:3 target:self selector:@selector(immunityFaded) userInfo:nil repeats:NO];
        ////
     }
//BELOW IS NOT GETTING CALLED
-(void)immunityFaded
{
    self.immune = NO;
    NSLog(@"no longer immune");
}
//BELOW IS GETTING CALLED FINE
-(void)immunityFading
{
    ...
    [self addChild:plusone];
    [self animateWithPusleFading:plusone];
}

Can anyone think of a reason why the 2nd NSTimer isn't being called? I've put a break in the IF statement on the NStimer and it breaks, but when i put the Break on the -(void)immunityFaded it doesn't at all?

Manesh
  • 528
  • 6
  • 20
  • 2
    I refuse to answer NSTimer related Sprite Kit questions. NSTimer shouldn't be used with Sprite Kit, see: http://stackoverflow.com/a/23978854/201863 – CodeSmile Dec 17 '14 at 14:56

1 Answers1

0

immunitytobeFading is defined elsewhere, possibly with a strong reference.

immunityFades is defined only for the life of the method.

Gary Riches
  • 2,847
  • 1
  • 22
  • 19