我正在使用Xcode项目,并且遇到了一些问题。 在我的应用程序中,我有一个GPS位置,我在1000米范围内有一些出租车服务。我想找到我附近最近的服务。出租车服务位置从JSON解析。它看起来像从GPS位置计算距离
NSNumber * latitude = [[diction objectAtIndex:13]objectAtIndex:1];
NSLog(@"lng is =>%@", latitude);
NSNumber * longitude = [[diction objectAtIndex:13]objectAtIndex:2];
NSLog(@"lat is =>%@", longitude);
而且,我有自己的位置,这样的:
[locationManager stopUpdatingLocation];
NSLog(@"latitude: %f", newLocation.coordinate.latitude);
NSLog(@"longitude: %f", newLocation.coordinate.longitude);
我怎么能减去纬度和经度以上,为了找到最接近的服务。 最好的问候。
[看看这个答案](http://stackoverflow.com/a/2318927/119114) – Nate 2013-03-05 03:44:26