正在使用MKReverseGeocoder
在我的iPhone应用程序中查找当前位置。现在有一天,应用程序不应该找到当前位置。当我遇到问题时,我发现- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
代表出现以下错误。该错误消息是,didFailWithError中的MKReverseGeocoder位置查找程序错误{PBHTTPStatusCode = 503}响应:委托iPhone?
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];
}
任何人都可以请帮我解决这个问题吗?提前致谢。