Quote:
Originally Posted by varchar
I have solved this problem.
Basically the way to solve is to ignore the locationupdate if it is not very accurate or it is to old.
Below is the code... It works like a charm.... I get amazing accuracy... I am so happy!
Code:
// Called when the location is updated
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSDate* newLocationeventDate = newLocation.timestamp;
NSTimeInterval howRecentNewLocation = [newLocationeventDate timeIntervalSinceNow];
// Needed to filter cached and too old locations
if ((!currentLocation || currentLocation.horizontalAccuracy > newLocation.horizontalAccuracy) &&
(howRecentNewLocation < -0.0 && howRecentNewLocation > -10.0)) {
if (currentLocation)
[currentLocation release];
currentLocation = [newLocation retain];
}
}
...
|
Can u post a bit more code, e.g. where do u initialize currentLocation, how do u call timer, do u use timer in controller which is fired every n seconds etc.