MKErrorDomain error 4 iPhone

Marty picture Marty · Oct 13, 2010 · Viewed 8k times · Source

I keep getting this randomly when I run my gps app I'm building. It doesn't happen everytime, and the coordinates passed in are always valid (i nslog them). Is there documentation for these somewhere?

EDIT:

CLLocationCoordinate2D coord = CLLocationCoordinate2DMake(locManager.location.coordinate.latitude, locManager.location.coordinate.longitude);
geocoder1 = [[MKReverseGeocoder alloc] initWithCoordinate:coord];
geocoder1.delegate = self;
[geocoder1 start];

and then about half the time it returns an error. I tried releasing and re-assigning the geocoder if there was an error, but that didn't help. Only thing that did was restarting the app.

Answer

Claus Broch picture Claus Broch · Oct 13, 2010

In "MKTypes.h" in the MapKit framework, the following is defined:

Error constants for the Map Kit framework.

enum MKErrorCode {
   MKErrorUnknown = 1,
   MKErrorServerFailure,
   MKErrorLoadingThrottled,
   MKErrorPlacemarkNotFound,
};

...

MKErrorPlacemarkNotFound

The specified placemark could not be found.

This sounds like you are referencing some unknown placemark in your code? Or it could be that Google doesn't have a name for the position you are passing - however valid the coordinates may be.