我正在使用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