Instance Method

geocodePostalAddress:preferredLocale:completionHandler:

Submits a forward-geocoding requesting using the specified locale and Contacts framework information.

Declaration

- (void)geocodePostalAddress:(CNPostalAddress *)postalAddress preferredLocale:(NSLocale *)locale completionHandler:(CLGeocodeCompletionHandler)completionHandler;

Parameters

postalAddress

A postal address from the Contacts framework.

locale

The locale of the postal address. Specify nil to use the current locale of the user.

completionHandler

The handler block to execute with the results. The geocoder executes this handler regardless of whether the request was successful or unsuccessful. For more information on the format of this block, see CLGeocodeCompletionHandler.

Discussion

This method submits the specified location data to the geocoding server asynchronously and returns. When the request completes, the geocoder executes the provided completion handler on the main thread.

After initiating a forward-geocoding request, do not attempt to initiate another reverse- or forward-geocoding request. Geocoding requests are rate-limited for each app, so making too many requests in a short period of time may cause some of the requests to fail. When the maximum rate is exceeded, the geocoder passes an error object with the value network to your completion handler.

See Also

Geocoding an Address

- geocodeAddressString:inRegion:preferredLocale:completionHandler:

Submits a forward-geocoding requesting using the specified address string and locale information.

- geocodeAddressString:completionHandler:

Submits a forward-geocoding request using the specified string.

- geocodeAddressString:inRegion:completionHandler:

Submits a forward-geocoding request using the specified string and region information.

- geocodePostalAddress:completionHandler:

Submits a forward-geocoding requesting using the specified Contacts framework information.

- geocodeAddressDictionary:completionHandler:

Submits a forward-geocoding request using the specified address dictionary.

Deprecated