我正在使用MKReverseGeocoder
在我的 iPhone 应用程序中查找当前位置。现在有一天,该应用程序不应该找到当前位置。当我解决问题时,我发现来自- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
委托的以下错误响应。错误信息是,
SourceCache/ProtocolBuffer/ProtocolBuffer-92/Runtime/PBRequester.m:687 server returned error: 503
2012-07-10 12:21:29.773 Dial25[3046:707] didFailWithError:- Error Domain=NSURLErrorDomain Code=-1011 "The operation couldn’t be completed. (NSURLErrorDomain error -1011.)" UserInfo=0x264090 {PBHTTPStatusCode=503}
我使用了谷歌并找到了添加委托的答案,[geoder autorelease];
但didFailWithError:
我的应用程序仍然不应该找到当前位置。
-(void)startFindLocationService
{
NSLog(@"Starting Location Services");
CLLocationManager *locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
locationManager.distanceFilter = 20.0f;
}
-(void)findAddressByLatLong:(CLLocation *)currentLocation
{
CLLocationCoordinate2D locationToLookup = currentLocation.coordinate;
MKReverseGeocoder *reverseGeocoder = [[MKReverseGeocoder alloc] initWithCoordinate:locationToLookup];
reverseGeocoder.delegate = self;
[reverseGeocoder start];
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
{
NSLog(@"Error: %@", [error description]);
[geocoder cancel];
geocoder.delegate = nil;
[geocoder autorelease];
}
谁能帮我解决这个问题?提前致谢。