正在使用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];
}
任何人都可以請幫我解決這個問題嗎?提前致謝。