In my header i put
CLLocationManager *locationManager;
@property (nonatomic, retain) CLLocationManager *locationManager;
in my implementation file:
- (void)viewDidLoad
{
self.locationManager = [[[CLLocationManager alloc] init] autorelease];
self.locationManager.distanceFilter = 50.0f;
[self.locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
self.locationManager.delegate = self;
[locationManager startUpdatingLocation];
[super viewDidLoad];
}
then in the delegate method
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
NSLog(@"Location: %g,%g", newLocation.coordinate.latitude, newLocation.coordinate.longitude );
}
now I keep getting an old value for latitude and longitude
googled for a solution i could not find any, i don't understand what i am doing wrong,
Any help please