MapKit / CoreLocation二つ緯度/経度の間の距離を計算します
-
13-09-2019 - |
質問
...イムは、2点間の距離を決定するために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で非推奨となり、この方法ですか?
おかげ
解決 2
Xcodeプロジェクトバンドル内部project.pbxprojectファイルからフレームワークの検索ディレクトリを削除することで解決
他のヒント
あなたはプロジェクトにCoreLocationフレームワークを追加する必要があります。
所属していません StackOverflow