3

We are fetching the latitude and longitude from PHAsset properties we are using CLGeocoder to reverseGeocodeLocation using following method.

CLGeocoder * geoCoder = [CLGeocoder new];
[geoCoder reverseGeocodeLocation:loc completionHandler:^(NSArray<CLPlacemark *> * _Nullable placemarks, NSError * _Nullable error) {
    CLPlacemark *placeInfo = placemarks[0];

}    

we are getting placeInfo object but thoroughfare and subThoroughfare are always coming nil.

For the same photo photosapp is able to fetch thoroughfare and subThoroughfare.

Thank You in advance.

Himanshu Moradiya
  • 4,769
  • 4
  • 25
  • 49
AppleBee
  • 452
  • 3
  • 16

1 Answers1

0

thoroughfare and subThoroughfare property that might not contain data for some places. So instead of creatying address string using thoroghfare and subThoroghfare, use addressdictionary as follow:

 NSString *address = ABCreateStringWithAddressDictionary(placeInfo .addressDictionary, NO);
PlusInfosys
  • 3,416
  • 1
  • 19
  • 33
  • I have tried using placeInfo .addressDictionary but it is also returning the same where i am not able to get thoroughfare and subThoroughfare values in it but iOS photos app some how managed to get it. – AppleBee Feb 02 '17 at 10:01