3

次のコードは、最初の10 個の住所の座標のみを返します。しかし、それをデータベースに保存するには 100 個以上必要です。ジオコーダの制限はありますか? どうすればできますか?

 for(int i=0;i<count;i++)
{

    CLGeocoder *geoCode = [[CLGeocoder alloc] init];

    [geoCode geocodeAddressString:strcity completionHandler:^(NSArray *placemarks, NSError *error)
     {
         if (!error)
         {
             CLPlacemark *place = [placemarks objectAtIndex:0];
             CLLocation *location = place.location;
             CLLocationCoordinate2D coord = location.coordinate;

             NSString *tempLati=[[NSString alloc]initWithFormat:@"%g",coord.latitude];
             NSString *tempLongi=[[NSString alloc]initWithFormat:@"%g",coord.longitude];




             [objCountries.countryLatitude addObject:tempLati];
             [objCountries.countryLongitude addObject:tempLongi];

             [geoCode cancelGeocode];
         }
     }];


}
4

1 に答える 1