views:

470

answers:

1

Hello all I am developing an iPhone app which is a location aware app . Currentlly the app is working fine except the caching of previous location . The first time I start the application location manager fetches the current location and then I display nearby things based on the current location .

But from the next it uses previously fetched location and until I restart the phone it will fetch the same location . So up to this point I am clear that the location manager caches the location .

So my question is how to remove this cache and force the location manager to fetch a new location thanks

+4  A: 
yonel
I am just asking you for suggetion that what should be set in SEC_OLD_MAX ?
hib
Also what to do if the interval is greater then secs old max ?
hib
Usually the time difference to a current location is well below a second. If the time difference to now is greater than a second it is probably a cached location.
Felix
Thanks felix. One last thing if I get the caches one how to ignore it and get a new one should I sto and start the location manager again ?
hib
Just do nothing if the location is not recent enough and wait for the next one. You'll keep on getting new positions as long as you don't invoke the stopUpdatingLocation on the CLLocationManager (or if you delegate receive a "failed" event).
yonel
Thanks yonel . Got it .
hib