나는 위치의 좌표를 사용자의 현재 좌표와 비교합니다. 거리는 다음과 같이 출력됩니다 : 6056609.511004132946254686위치의 좌표를 사용자의 현재 좌표와 비교하는 방법
이것이 어떤 측정인지는 확실하지 않습니다. 최종 측정 거리를 km로 원합니다. 애플 문서에서 미터에서
// location of deal
CLLocation *locA = [[CLLocation alloc] initWithLatitude:latNum longitude:lngNum];
// user's current location
CLLocation *locB = [[CLLocation alloc] initWithLatitude:currentLatitude longitude:currentLongitude];
CLLocationDistance distanceToDeal = [locA distanceFromLocation:locB];
이 이유는 무엇입니까? –
@ АртёмЦарионов -1 "이 질문은 연구 노력을 보이지 않습니다"라는 교과서 예제이기 때문에 -1. 이 방법에 대한 도움말을 가져 오면 리턴 코드에 대한 설명이 하나 있습니다 : "두 위치 간 거리 (미터)". 더 명확하지 않을 수 있습니다. 사람들은 질문을 올리기 전에 문서를 읽어야합니다. – Rob