【发布时间】:2010-03-21 11:55:04
【问题描述】:
好的,多亏了 Claus Broch,我在比较两个 GPS 位置方面取得了一些进展。我需要能够说“如果当前位置等于(列表中的任何 GPS 位置)然后做点什么
我现在的代码是:
CLLocationCoordinate2D bonusOne;
bonusOne.latitude = 37.331689;
bonusOne.longitude = -122.030731;
Infinite Loop 的模拟器 GPS 位置是什么
CLLocation *loc1 = [[CLLocation alloc] initWithLatitude:bonusOne.latitude longitude:bonusOne.longitude];
double distance = [loc1 getDistanceFrom:newLocation];
if(distance <= 10000000) {
然后做点什么 }
任何小于 10000000 的数字都假定不匹配。
【问题讨论】:
标签: iphone objective-c xcode gps cllocation