这是一段示例代码:
[_geoCoder reverseGeocodeLocation:self.locationManager.location // You can pass aLocation here instead
completionHandler:^(NSArray *placemarks, NSError *error) {
dispatch_async(dispatch_get_main_queue(),^ {
// do stuff with placemarks on the main thread
if (placemarks.count == 1) {
CLPlacemark *place = [placemarks objectAtIndex:0];
// NSLog([place postalCode]);
NSString* addressString1 = [place thoroughfare];
addressString1 = [addressString1 stringByAppendingString:[NSString stringWithFormat:@"%@",[place.addressDictionary objectForKey:(NSString*)kABPersonAddressZIPKey]]];//
NSLog(@"%@",addressString1);// is null ??
NSlog(@"%@",place.postalCode);//is null ??
//[self performSelectorInBackground:@selector(log) withObject:nil];
}
});
}];