Am using MKReverseGeocoder
to find the current location in my iPhone app. Now a days the app should not find the current locations. When i trouble shoot the problem i have found the following error response from - (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error
delegate. The error message is,
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}
I have used Google and found the answer to add [geoder autorelease];
in the didFailWithError:
delegate but still my app should not find the current locations.
-(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];
}
Can anyone please help me to solve the problem? Thanks in advance.