Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>The method reverseGeocodeLocation:completionHandler: is executed asynchronously, which means that it will move on to the next lines before it finishes.</p> <p><a href="https://stackoverflow.com/questions/748175/asynchronous-vs-synchronous-execution-what-does-it-really-mean">Asynchronous vs synchronous execution, what does it really mean?</a></p> <p>It is called asynchronously because the method reverseGeocodeLocation:completionHandler: might need some time to do it, and when it is finished, the completion block is called. </p> <p>You should place the new birthplace pin only after the completion block of the reverseGeocodeLocation is called, for example inside the completion block, to ensure you have got the placemark data first before placing the pin. Or you can just update the subtitle of the newly added pin inside the completion block.</p> <pre><code>[ceo reverseGeocodeLocation: loc completionHandler: ^(NSArray *placemarks, NSError *error) { CLPlacemark *placemark = [placemarks objectAtIndex:0]; //String to hold address NSString *locatedAt = [[placemark.addressDictionary valueForKey:@"FormattedAddressLines"] componentsJoinedByString:@", "]; // save the address text globalsSingle.gblAddress = locatedAt; //place new birthplace pin MKPointAnnotation *birthPlacePin = [[MKPointAnnotation alloc] init]; birthPlacePin.coordinate = globalsSingle.gblBirthplace; birthPlacePin.title = @"My Birthplace"; birthPlacePin.subtitle = globalsSingle.gblAddress; [self.fullMapView addAnnotation:birthPlacePin]; } ]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload