I run this code in viewDidLoad, but it doesn't even run the print(!!!) statement. What should I check? Instead of <address>, I have a real address. geocoder.geocodeAddressString(<address>) { [weak self] placemarks, error in print(!!!) guard !(error != nil) else { print(error) return } if let placemarks = placemarks, let placemark = placemarks.first { self!.church = placemark print(self!.church) } else { print(Church cannot be found.) } }
Search results for
geocodeAddressString
17 results found
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In my application I am trying to use Geocoder, but only one value is always returned when requested. This cannot be, since many addresses must be displayed by the name of the street. I would like to know if there is a solution to this problem or should I use a different tool? Code CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder geocodeAddressString:@Хользунова completionHandler:^(NSArray* placemarks, NSError* error) { if (error) { return; // TODO: handle error } NSLog(@Count placemarks: %@, @(placemarks.count)); for (CLPlacemark *placemark in placemarks) { NSLog(@Placemark: %@, placemark); } }];