好的,多亏了 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 的数字都假定没有匹配项。