2012-01-02 15 views
2

私はマップキットで作業しています。UILongPressGestureRecognizerクラスを使用してマップキットの場所を変更するタスクがありますが、いつも正常に緯度と経度を取得できます。私はこのようにしています。iphoneデベロッパーの逆ジオコーダーで奇妙な出力を取得する

UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] 
             initWithTarget:self action:@selector(handleGesture:)]; 
lpgr.minimumPressDuration = 2.0; //user must press for 2 seconds 
[mapView addGestureRecognizer:lpgr]; 
[lpgr release]; 



- (void)handleGesture:(UIGestureRecognizer *)gestureRecognizer 
{ 

MKPointAnnotation *pa = [[MKPointAnnotation alloc] init]; 
pa.coordinate = touchMapCoordinate; 
temp.latitude= pa.coordinate.latitude; 
temp.longitude= pa.coordinate.longitude; 
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:pa.coordinate]; 
reverseGeocoder.delegate = self; 
[reverseGeocoder start]; 


} 
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark 
{ 
temp.location = ABCreateStringWithAddressDictionary(placemark.addressDictionary, NO); 
NSLog(@"original location is %@",temp.location); 

} 

しかし、私はこの

/SourceCache/ProtocolBuffer/ProtocolBuffer-92/Runtime/PBRequester.m:687 server returned error: 503 2012-01-02 16:19:36.284 openInvite[303:707] reverseGeocoder: didFailWithError:Error Domain=NSURLErrorDomain Code=-1011 "The operation couldn’t be completed. (NSURLErrorDomain error -1011.)" UserInfo=0x124ea0 {PBHTTPStatusCode=503}

のようなエラーを得たいくつかの時間は、その上で私を助けてください。

答えて

1

HTTPステータスコードがヒントです。

503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

Note: The existence of the 503 status code does not imply that a 
    server must use it when becoming overloaded. Some servers may wish 
    to simply refuse the connection. 

HTTPステータスコードを確認し、HTTPステータスコードを再度確認してください。これは問題を解決するはずです

+0

私は自分のアプリをiTunesにアップロードしようとしているので、この問題を永続的に解決するにはどうすればよいですか? – Aleem

+0

サーバが接続を拒否している場合は、もう一度接続を試みる可能性はありません。確かにあなたは無限にそれをするべきではないので、あなたはまた、要求の数に制限を実装すべきです。 –

+0

hmmm ok、ありがとう。 – Aleem