1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
__block NSString * response; //la fameuse !
[deviceInfo.geocoder reverseGeocodeLocation:deviceInfo.locationProperties completionHandler:
^(NSArray *placemarks, NSError *error) {
[placemarks copy];
//Get nearby address
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"Country : %@",placemark.country);
response =placemark.country;
NSLog(@"Response COUNTRY : %@",response); // ça affiche une réponse au bout de X secondes
}];
//-----------------------------------------------
NSLog(@"Response COUNTRY : %@",response); // response vaut NULL |