0

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} 

나는 구글을 사용하고 didFailWithError: 위임에 [geoder autorelease];을 추가 할 수 있지만 여전히 내 앱이 현재 위치를 찾을해야 답을 발견 한 것입니다.

-(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]; 
} 

누구든지 문제를 해결할 수 있습니까? 미리 감사드립니다.

답변

0

직접 지오 코딩에 대해 자세히 알아보고 도움이 될만한 다른 참조를 발견했을 수 있습니다.

  1. 여러 MKReverseGeocoder 클래스 메서드에서 iOS 5부터 사용되지 않습니다 : 문제는 구글은 하루 중 특정 시간에 MKReverseGeocoder 요청에 대한 응답으로 2010 년에 다시이 http://developer.apple.com/library/ios/#documentation/MapKit/Reference/MKReverseGeocoder_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/doc/uid/TP40008323-AppendixA

  2. 했다. 이 문제가 귀하의 문제와 관련이 있는지는 모르겠지만 애플이이 방법을 사용하지 않는 이유와 관련이있을 수 있습니다. http://blog.aribraginsky.com/2009/12/curious-case-of-mkreversegeocoder.html

  3. 참조 로한 카 푸르의 솔루션은 CLGeocoder로 전환하여 버그를 MKReverseGeocoder하기 :이 도움이 Using MKReverseGeocoder in a singleton class (ARC)

희망!