在iphonedev的反向地理编码器中获得奇怪的输出

在iphonedev的反向地理编码器中获得奇怪的输出,iphone,mapkit,Iphone,Mapkit,我正在使用地图工具包,我的任务是使用uilongpressurerecognizerclass更改地图工具包中的位置,我总是成功地获取纬度和经度,但有时无法获取位置。我就是这样做的 UILongPressGestureRecognizer *lpgr = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleGe

我正在使用地图工具包,我的任务是使用
uilongpressurerecognizer
class更改地图工具包中的位置,我总是成功地获取纬度和经度,但有时无法获取位置。我就是这样做的

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 服务器返回错误:503 2012-01-02 16:19:36.284 openInvite[303:707] reverseGeocoder:didFailWithError:错误 Domain=nsurErrorDomain Code=-1011“无法执行该操作 已完成。(NSURlerDomain错误-1011。)“UserInfo=0x124ea0 {PBHTTPStatusCode=503}


请帮我一下。

HTTP状态码就是线索

503服务不可用

由于发生错误,服务器当前无法处理该请求 服务器的临时过载或维护。这意味着 这是一种暂时的情况,经过一段时间后会得到缓解 延迟如果已知,延迟的长度可以用 在标头之后重试。如果没有在之后重试,客户端应该 像处理500响应一样处理响应

  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状态代码,并检查其503是否再次发送请求。这应该可以解决问题

这是反复尝试的最佳方法,因为我要将我的应用程序上载到itunes上,因此如何永久解决此问题?如果服务器拒绝连接,您就没有其他可能重试。当然,您不应该无限期地这样做,因此您还应该对请求的数量进行限制。