0

My location manager is not updating my coordinates of current locations so that i cant able to trace that address.......

I am using the following code,

- (void)viewDidLoad
{
    [super viewDidLoad];

    locationManager = [[CLLocationManager alloc] init];
    //locationManager.desiredAccuracy = kCLLocationAccuracyBest;
    locationManager.delegate = self;
    [locationManager startUpdatingLocation];
   // startLocation = nil;
    [super viewDidLoad];

}
-(void)locationManager:(CLLocationManager *)manager
   didUpdateToLocation:(CLLocation *)newLocation
          fromLocation:(CLLocation *)oldLocation
{

  NSLog(@"Latitude:%f Longitude:%f", newLocation.coordinate.latitude, newLocation.coordinate.longitude);
    geocoder =[[[MKReverseGeocoder alloc] initWithCoordinate:newLocation.coordinate]autorelease];
    geocoder.delegate=self;
    [geocoder start];
  }
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error
{
    NSLog(@"%@Error",[error description]);
}  
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark{
    NSString *street=[placemark.addressDictionary objectForKey:@"Street"];
    NSLog(@"%@",street);

}

It shows the error report

Error Domain=kCLErrorDomain Code=0 "The operation couldnft be completed. (kCLErrorDomain error 0.)"Error

How to overcome this?.

varth_FD
  • 137
  • 1
  • 2
  • 12

0 Answers0