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
Post a Comment