That's an iOS 5.0.x behavior. In 5.1 and later, it turns kCLErrorNetwork
as you would have expected. If you use the macros from https://stackoverflow.com/a/5337804/1271826 you could theoretically do something like:
[geocoder reverseGeocodeLocation:whatever completionHandler:^(NSArray *placemarks, NSError *error) {
if (error)
{
if (error.code == kCLErrorNetwork || (error.code == kCLErrorGeocodeFoundPartialResult && SYSTEM_VERSION_LESS_THAN(@"5.1")))
{
Alert(@"No Internet connection!");
}
}
else
{
// ...
}
}];
That way, you'll handle the network error regardless of what iOS version the user is running (though, obviously, only 5.0 and later, given that CLGeocoder
was introduced in iOS 5.0).