iphone - NSTimer getting zombie -


i have created nstimer in application gets fired after every 1 min interval. problem when put application in background , after time 5 min, bring in foreground, timer object gets zombied.

any thoughts on this.

perhaps invalidate timer when application enters background start again when application enters foreground.

like so:

- (void)applicationdidenterbackground:(uiapplication *)application {     [mytimer invalidate]; }  - (void)applicationwillenterforeground:(uiapplication *)application {     mytimer = [nstimer scheduledtimerwithtimeinterval:60.0 target:self selector:@selector(timerfunction) userinfo:nil repeats:yes]; } 

Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -