【发布时间】:2009-12-07 00:13:28
【问题描述】:
我希望在 CoreLocation 中使用 getDistanceFrom 方法来确定两点之间的距离,但在尝试使用 CoreLocation 时出现错误...
我正在使用 3.1.2。我试过这个,但返回错误:
CLLocation *userLoc = [[CLLocation alloc] initWithCoordinate:appDelegate.mapView2.userLocation.coordinate];
CLLocation *poiLoc = [[CLLocation alloc] initWithLatitude: [aPOI.latitude doubleValue] longitude: [aPOI.longitude doubleValue]];
double dist = [userLoc getDistanceFrom:poiLoc] / 1000;
NSLog(@"%d",dist);
给出的错误:
".objc_class_name_CLLocation", referenced from:
literal-pointer@__OBJC@__cls_refs@CLLocation in POIDetailViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
我错过了什么吗?我已经导入了CoreLocation...
此方法在 3.1.2 中是否已弃用?
谢谢
【问题讨论】:
-
好吧,我修复了错误,但现在我收到了一个巨大的数字(1862709713)返回
dist?为什么会这样?
标签: core-location