You have an address of a location and you want to find the spatial location (longitude, latitude) of that address.
Reverse geocoding is the process of
retrieving a meaningful address, city and country, and so on, using
spatial locations (Longitude, Latitude).
Geocoding, on the other hand, is the process of
finding the spatial locations of a given address. Both geocoding
and reverse geocoding facilities are encapsulated into
CLGeocoder class in the Core
We geocode spatial locations by passing the address as
NSString to the
CLGeocoder class. The
completionHandler parameter of this method
accepts a block object that returns no value and has two
A placemarks array (of type
NSArray), which will be set to the
locations that matched your search.
An error (of type
which will get set to an error code if the geocoding fails.
Let’s go ahead and declare a property of type
Now, let’s go ahead and implement the code to geocode an address:
/* We have our address */
@"1005 Gravenstein ...