iphone - How can I have an NSTimer going throughout the entire time the user is in the app? -
how can have nstimer going throughout entire time user in app?
i want able change view controllers , perform different functions, while timer going on int background. if timer hits 0, want fire event. can have timer going inside app while app in background? or when iphone's screen off?
thanks answers!
run method in app delegate
-(void) timerfunc{ nsautoreleasepool * pool = [[nsautoreleasepool alloc] init]; timer = [nstimer scheduledtimerwithtimeinterval:(0.5) target:self selector:@selector(yourfunction) userinfo:nil repeats:yes ]; [pool release]; }
Comments
Post a Comment