【发布时间】:2013-07-09 09:58:27
【问题描述】:
我目前正在为 iOS 开发一个移动应用程序,其中包含需要确定用户当前位置的部分,我想从当前位置找到最近的位置。
有没有办法实现这个??
我已经编写了一些代码来查找用户的当前位置。 这是我的代码 sn-p,
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
[geocoder reverseGeocodeLocation:locationManager.location
completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"reverseGeocodeLocation:completionHandler: Completion Handler called!");
if (error){
NSLog(@"Geocode failed with error: %@", error);
return;
}
CLPlacemark *placemark = [placemarks objectAtIndex:0];
NSLog(@"placemarks=%@",[placemarks objectAtIndex:0]);
但我的问题是,我如何才能到最近的其他位置?从我已经获取的当前位置。
提前致谢。
【问题讨论】:
-
转到this Link,这也有类似的问题。我想这会对你有所帮助。
标签: iphone ios ipad geocoding clgeocoder