Can geocodeAddressDictionary in iOS 9 be implemented unlike iOS 8

I look at a set of addresses and execute a geocode on each of them.

for aClient in passedPossible { let geocoder = CLGeocoder() let checkAddress = [ CNPostalAddressStreetKey:aClient[CNPostalAddressStreetKey]!, CNPostalAddressCityKey:aClient[CNPostalAddressCityKey]!, CNPostalAddressPostalCodeKey:aClient[CNPostalAddressPostalCodeKey]!, CNPostalAddressCountryKey:"Australia" ] geocoder.geocodeAddressDictionary(checkAddress, completionHandler: { (placemarks, error) -> Void in // Etc do stuff... } 

In iOS 8.4, I can pass 250 elements, execute a loop, and get a callback for each of them.

But in iOS 9.0 with the same code, it fails, giving me errors for all but 40 elements.

The error I am returning is

Domain Error = kCLErrorDomain Code = 2

I believe that apple doesn’t like mass geocoding?

But why does it work in 8.4, and not now in 9.0

Think I need to use mapQuest?

Thanks for any input.

+1
ios mapkit geocoding
Aug 17 '15 at 23:28
source share
1 answer

iOS 9 may be more restrictive regarding this statement in the documentation:

Geocoding requests are limited in speed for each application, so too many requests in a short period of time can cause some of the requests to fail. When the maximum speed is exceeded, the geocoder sends an error object with the value kCLErrorNetwork to your completion handler.

+1
Aug 18 '15 at 7:36
source share



All Articles