ios - How can I get location from app in background/foreground after every 5 min -


how can it?

-(void)updatelocation {  [self performselector:@selector(updatelocation) withobject:nil afterdelay:300];  [self.locationtracker updatelocationtoserver]; } 

but it's not working every time.

try use nstimer

nsinteger minutes = 5; [nstimer scheduledtimerwithtimeinterval:60 * minutes                                  target:self                                selector:@selector(updatelocation)                                userinfo:nil                                 repeats:yes]; 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

Command prompt result in label. Python 2.7 -