Geocoding an Address

The sample app enables the user to add a new favorite place by entering an address in ICFFavoritePlaceViewController. The user can tap Geocode Location Now to get the latitude and longitude, as shown in Figure 2.10.

Image

Figure 2.10 FavoritePlaces sample app: adding a new favorite place.

When the user taps the Geocode Location Now button, the geocodeLocationTouched: method is called. That method begins by concatenating the address information provided by the user into a single string, like “2100 York St, Denver, CO 80205,” to provide to the geocoder.

NSString *geocodeString = @"";if ([self.addressTextField ...

Get iOS Components and Frameworks: Understanding the Advanced Features of the iOS SDK now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.