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

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

javascript - Clean way to programmatically use CSS transitions from JS? -

android - send complex objects as post php java -