title: didUpdateToLocation is never called
body: <p>I want to pass information about the location of the user to another function which uses it. The delegate class <code>MyLocation</code> is a singleton which stores this information. </p>
  
  <p>But in my code the <code>didUpdateToLocation</code> never gets called . Should n't it be called at least once whenever <code>startUpdatingLocation</code> is called even if the device is stationary? </p>
  
  <p>I did check if <code>locationmanager.location.coordinate.latitude</code> and <code>locationmanager.location.coordinate.longitude</code> have the right values and they do. The location services are enabled and the user permission to access location services is also granted. I am still building for iOS 5. None of the previously given solutions seem to work for me!</p>
  
  <p>Can someone please give me some idea as to why it is not working?</p>
  
  <p>The code is as follows: </p>
  
  <pre><code>CLLocationManager *locationManager;
  CLGeocoder *geocoder;
  CLPlacemark *placemark;
  
  @implementation MyLocation {
  }
  
  + (id)getInstance {
      static MyLocation *sharedMyLocation = nil;
      static int i=0;
      if(i==0){
          sharedMyLocation = [[MyLocation alloc] init];
          i=1;
      }
      return sharedMyLocation;
  }   
  
  - (id)init {
      if (self = [super init]) {
          latitude = [[NSString alloc] init];
          longitude = [[NSString alloc] init];
          country = [[NSString alloc] init];
          admin_area = [[NSString alloc] init];
          postal_code = [[NSString alloc] init];
          locality = [[NSString alloc] init];
          subtfare = [[NSString alloc] init];
          tfare = [[NSString alloc] init];
      }
      return self;
  }
  
  - (void) startupdate{
      if(locationManager == nil)
      {
          locationManager = [[CLLocationManager alloc] init];
          locationManager.delegate = self;
          locationManager.desiredAccuracy = kCLLocationAccuracyBest;
      }
      if(geocoder == nil)
         geocoder = [[CLGeocoder alloc] init];
  
  
      [locationManager startUpdatingLocation];    
  }
  
  
  - (void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error  
  {
      NSLog(@"didFailWithError: %@", error);
  }
  
  - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation        *)newLocation fromLocation:(CLLocation *)oldLocation
  {
      NSLog(@"didUpdateToLocation: %@", newLocation);
      CLLocation *currentLocation = newLocation;
  
      if(currentLocation != nil){
          longitude = [NSString stringWithFormat:@"%.8f",   currentLocation.coordinate.longitude];
          latitude = [NSString stringWithFormat:@"%.8f", currentLocation.coordinate.latitude];
      }
  
      [locationManager stopUpdatingLocation];
  
      // Reverse Geocoding
      NSLog(@"Resolving the Address");
      [geocoder reverseGeocodeLocation:currentLocation completionHandler:^(NSArray *placemarks, NSError *error) {
          NSLog(@"Found placemarks: %@, error: %@", placemarks, error);
          if (error == nil &amp;&amp; [placemarks count] &gt; 0) {
              placemark = [placemarks lastObject];
              country = [NSString stringWithFormat:@"%@",placemark.country];
              admin_area = [NSString stringWithFormat:@"%@",placemark.administrativeArea];
              postal_code = [NSString stringWithFormat:@"%@",placemark.postalCode];
              locality = [NSString stringWithFormat:@"%@",placemark.locality];
              subtfare = [NSString stringWithFormat:@"%@",placemark.subThoroughfare];
              tfare = [NSString stringWithFormat:@"%@",placemark.thoroughfare];
          } else {
              NSLog(@"%@", error.debugDescription);
          }
      } ];
  }
  
  
  - (NSString*)  getLatitude
  {
      return latitude;
  }
  
  
  - (NSString*) getLongitude
  {
      return longitude;
  }
  
  - (NSString*) getCountry
  {
      return country;
  }
  
  - (NSString*) getAdminArea
  {
      return admin_area;
  }
  
  - (NSString*) getPostalCode
  {
      return postal_code;
  }
  
  - (NSString*) getLocality
  {
      return locality;
  }
  
  - (NSString*) getSubTFare
  {
      return subtfare;
  } 
  
  - (NSString*) getTFare
  {
      return tfare;
  }
  
  
  error GPS_INTERFACE::getLatitude(char* buffer , unsigned int len)
  {
      id temp = [MyLocation getInstance];
      [temp startupdate];
      NSString* tempbuf = [temp getLatitude];
      NSString *l = [NSString stringWithFormat:@"%@",tempbuf];
      const char* lati= [l UTF8String];
      if(strlen(lati) &lt; len)
          std::strncpy(buffer,lati,[l length]);
      else 
          return Buffer_Insufficent;
  
      return No_Error; 
  }
  /* other similar getter functions! */
  </code></pre>