here is the code
-(void)manageAnimation:(Properties *)prop
{
//if(bounceTimer.isValid)
// [bounceTimer invalidate];
bounceTimer = [NSTimer scheduledTimerWithTimeInterval:.05 target:self selector:@selector(animate) userInfo:nil repeats:YES];
}
-(void)animate{
static float t = 0;
float d = .5;
static float fValue = 0;
fValue = [self easeOutBounce:t andB:0 andC:34 andD:d];
[self setNeedsDisplay];
t += .5/10;
if(t > d){
[bounceTimer invalidate];
t = 0;
fValue = 0;
}
}
I am calling manageAnimation after each second. When i click info button on screen it flips to settings screen, when i click done button on settings screen to go back to main screen the application crashes. If i comment out the code
//bounceTimer = [NSTimer scheduledTimerWithTimeInterval:.05 target:self selector:@selector(animate) userInfo:nil repeats:YES];
Then application works ok. I am not sure whats going on, also i found that when i switched to settings view these timers are stopped.