Last active
August 29, 2015 14:24
-
-
Save anoadragon453/be710fda30053117107e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLGeocoder *geocoder = [CLGeocoder new]; | |
[geocoder geocodeAddressString:@"ADDRESS_TO_SEARCH" completionHandler:^(NSArray *placemarks, NSError *error) { | |
if (error) { | |
NSLog(@"Error: %@", [error localizedDescription]); | |
return; // Request failed, log error | |
} | |
// A location was generated, hooray! | |
if (placemarks && [placemarks count] > 0) { | |
CLPlacemark *placemark = placemarks[0]; // Our placemark | |
// Do something with the generated placemark | |
NSLog(@"Lat: %f, Long: %f", placemark.location.coordinate.latitude, placemark.location.coordinate.longitude); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment