Search code examples
iosmkreversegeocoder

How to deal with MKReverseGeocoder / PBHTTPStatusCode=503 errors in iOS 4.3?


Since iOS 4.3 (GM Seed 10M2518) I'm getting crashes when using MKReverseGeocoder. reverseGeocoder:didFailWithError: gets called with an error like this quite often:

Error Domain=NSURLErrorDomain Code=-1011 "The operation couldn’t be completed. (NSURLErrorDomain error -1011.)" UserInfo=0x339900 {PBHTTPStatusCode=503}

The app tends to crash at these moments. This hasn't been the case in previous versions of iOS.

Any ideas what happened?


Solution

  • Make sure you don't release the reverse geocoder prematurely on failure:

    Changing [_reverseGeocoder release] to [_reverseGeocode autorelease] in -(void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error fixed the problem for me.