reverseGeocode always return error code 2 with a CLLocation object created by myself.

Some of my app users complain about their address not correct.

For example someone said he live in London, but I get his address is Belfast by CLGeocoder, hundreds of kilometers away.

So I want to find out what's going on.

I use his coordinate to create a CLLocation object, then get it's address with the following code:


    CLLocation *location = [[CLLocation alloc] initWithLatitude:x longitude:y];
    CLGeocoder *geocoder = [[CLGeocoder alloc] init];
    [geocoder reverseGeocodeLocation:location completionHandler:^(NSArray *placemarks, NSError *error) {
          //....

     }];

But it's alway return an error, no matter what I use the simulator or a real iPhone:

Error Domain=kCLErrorDomain Code=2 "(null)"


And it work fine when I use a CLLocation object got from CLLocationManager.


The same thing is happened with the official GeocoderDemo download from

https://developer.apple.com/library/prerelease/ios/samplecode/GeocoderDemo/Introduction/Intro.html


How can I get a address from the location I created?

Or is there something I missed to get some one's address?

By the way sometimes the address got from IP is more accuracy got from CLGeocode.

reverseGeocode always return error code 2 with a CLLocation object created by myself.
 
 
Q