title: Wait an asynchronous callback - Objective-C
body: <p>I had some trouble with CLLocationManager callbacks<br>
  What is the best way to wait an asynchronous callback ?</p>
  
  <p>Here is what i basically want to do :</p>
  
  <pre> 
  
  - (NSString *)getCurrentCity 
  {
         [self.locationManager startUpdatingLocation];
         // Wait for coordonate in callbacks
         self.geocoder = [MKReverseGeocoder alloc] initWithCoordonate:self.newCoordonate];
         [self.geocoder start];
         // Wait for information with MKReverse callbacks
         return self.currentCity;
  }
  // Callbacks methods of MKReverseGeocoder and CLLocationManager
  - (void)locationManager:(CLLocationManager *)manager
       idUpdateToLocation:(CLLocation *)newLocation
             fromLocation:(CLLocation *)oldLocation 
  {
          CLLocationCoordinate2D newCoordonate = newLocation.coordinate;
          self.currentCoordonate = &newCoordonate;
  }
  
  - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder 
         didFindPlacemark:(MKPlacemark *)placemark 
  {
         self.currentCity = placemark.locality;
  }
  </pre>
  
  <p>Where self.currentCity and self.newCoordonate is an attribut in my classe.</p>
  
  <p>I tried some tricks like Thread and/or synchronized but i didn't managed it to dont return before all is finish.</p>
  
  <p>Best regards</p>