NSTimer stop when app is hide?

Maybe your timer is getting garbage collected or otherwise freed perhaps by the autorelease pool, and hence does not fire anymore Try doing this: (IBAction)recordCam1:(id)sender { myTimer = NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(recordFile1:) userInfo:Nil repeats:YES; myTimer retain; } where myTimer is an instance variable in your class. See if that produces a different behaviour. If so, then you know the problem is to do with memory management.

Maybe your timer is getting garbage collected or otherwise freed perhaps by the autorelease pool, and hence does not fire anymore. Try doing this: - (IBAction)recordCam1:(id)sender { myTimer = NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(recordFile1:) userInfo:Nil repeats:YES; myTimer retain; } where myTimer is an instance variable in your class. See if that produces a different behaviour.

If so, then you know the problem is to do with memory management.

A scheduled timer will be retained by the run loop in manual-retain/release-land; I don't know how it goes under GC or ARC. Under GC, the retain message does nothing; simply storing the pointer in an instance variable (that isn't marked as __weak) is a strong reference that will keep it alive. – Peter Hosey Jun 18 at 5:57.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions