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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -