Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS: how to execute an high number of reverseGeocoding request?
    primarykey
    data
    text
    <p>i have to execute a high number of reverseGeocodeLocation request, i use this method for doing that:</p> <pre><code> for (Photo *photo in arrayWhitPicture) { CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [queue addOperationWithBlock:^{ [geocoder reverseGeocodeLocation:[[CLLocation alloc] initWithLatitude:[photo.latitude doubleValue] longitude:[photo.longitude doubleValue]] completionHandler:^(NSArray *placemarks, NSError *error) { if (error){ NSLog(@"Geocode failed with error: %@", error); return; } CLPlacemark *myPlacemark = [placemarks objectAtIndex:0]; NSString *city = myPlacemark.locality; NSLog(@"My country code: %@", city); }]; }]; } </code></pre> <p>this code actual work, but the problem is that some of these request (like half) get this error:</p> <pre><code>Error Domain=kCLErrorDomain Code=2 </code></pre> <p>after a few research i think this happen because i do a lot of request in short amount of time in fact the apple documentations say:</p> <blockquote> <p>Send at most one geocoding request for any one user action.</p> <p>When you want to update the user’s current location automatically (such as when the user is moving), issue new geocoding requests only when the user has moved a significant distance and after a reasonable amount of time has passed. For example, in a typical situation, you should not send more than one geocoding request per minute.</p> </blockquote> <p>so my question is: my error is really caused by the fact that i do a lot of request, and in that case what can i do to resolve this problem, do you know other system apart to use the reverseGeocoding?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload