geocoding address into coordinates in iphone

后端 未结 3 754
迷失自我
迷失自我 2020-12-25 12:16

I am trying to geocode address into coordinates using following code:

CLGeocoder *geocoder = [[CLGeocoder alloc] init];
    [geocoder geocodeAddressString:@\         


        
3条回答
  •  执念已碎
    2020-12-25 13:01

    I just ran that exact code and it worked as expected. Make sure that you have an active internet connection.

    Try adding a NSLog on the strings and see if it gets called.

    NSLog(@"lat: %@, lng: %@", latDest1, lngDest1);
    

    Are you running it in the simulator or the device?

提交回复
热议问题