私はこのエラーを繰り返し発生していて、それを停止させる方法を理解できませんでした。しかし、私はついに問題全体を回避するエンドランを見つけました。これは非常にうまく機能し、もう少し作業が必要です。Appleをまったく使用しないでください。代わりに、 Googleの逆ジオコーディングAPIMKReverseGeocoder
を直接呼び出します(これは明らかに同じサービスです)。それは舞台裏で行われます)。JSONまたはXML(好み)のいずれかを取り戻すことができ、それを解析する必要がありますが、それはそれほど難しいことではありません。MKReverseGeocoder
たとえば、私のアプリはを使用してASIHTTPRequest
いるので、これは次のようになります(ただし、これは、などのAppleのネイティブAPIを使用して行うのも簡単ですNSURLConnection
)。
#pragma mark -
#pragma mark CLLocationManagerDelegate
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
// Be careful: My code is passing sensor=true, because I got the lat/long
// from the iPhone's location services, but if you are passing in a lat/long
// that was obtained by some other means, you must pass sensor=false.
NSString* urlStr = [NSString stringWithFormat:
@"http://maps.googleapis.com/maps/api/geocode/xml?latlng=%f,%f&sensor=true",
newLocation.coordinate.latitude, newLocation.coordinate.longitude];
NSURL* url = [NSURL URLWithString:urlStr];
self.reverseGeocoderRequest = [ASIHTTPRequest requestWithURL:url];
self.reverseGeocoderRequest.delegate = self;
[self.reverseGeocoderRequest startAsynchronous];
}
ちなみに、GoogleのAPIには、Appleと同じようにルールがあります。特にクォータに関しては、必ずドキュメントをお読みください。