I have read that iOS limits an app to about 50 geocode requests at a time. What if I have large sets, maybe 200? Is there any way I can geocode more than 50 sets at a time? For example, using delays between sets, with each set limited to 50. What would be an ideal way to delay the geocoding between sets?
I have seen NSProgrammer's answer to the following question:
iPhone iOS5 CLGeocoder how to geocode a large (200) set of addresses?
Any suggestions for the kind of delay he mentioned? Would that delay be inside the handler and running on another thread?
for(int i = 0; i < [myArray count]; i++){
[call geoCoderMethod];
}
-geoCoderMethod{
[geocoder geocodeAddressString:addressString completionHandler:^(NSArray *placemarks, NSError *error) {
getCo-ordinates;
add annotation to mapview;
}
I tried splitting the array into chunks of 25 items each and calling the geoCoderMethod
and induce the delay using performSelector
method. But the performSelector
method and geoCoder
seems to be running in different threads and I am not able to cause a delay in between the method call.