我正在计算两个位置之间的距离,如下所示
CLLocation *locA = [[CLLocation alloc] initWithLatitude:lat longitude:lon];
CLLocationCoordinate2D coordinate = [self getLocation];
CLLocation *locB = [[CLLocation alloc] initWithLatitude:coordinate.latitude longitude:coordinate.longitude];
CLLocationDistance distance = [locA distanceFromLocation:locB];
CLLocationDistance kilometers = distance / 1000.0;
但是当我连接到 wifi 和 3G 网络时,它给出了不同的结果。如何为两者获得相同的结果。