MapKit计算两个中纬度之间的距离多少M

MapKit计算两个经纬度之间的距离多少MCLLocationManager *locmanager [[CLLocationManager alloc]init]

MapKit计算两个经纬度之间的距离多少M
    CLLocationManager *locmanager = [[CLLocationManager alloc]init];//先定义一个cllocationmanager的实例
    [locmanager setDelegate:self]; //设置代理为本身
    [locmanager setDesiredAccuracy:kCLLocationAccuracyBest];//设置精确度为最准确
    [locmanager startUpdatingLocation];//更新 location
   
    //定义一个新的CLLocation实例,下面会取得user location 和这个新的地点间的距离
    CLLocation * newLocation = [[CLLocation alloc]initWithLatitude:32.0206410 longitude:118.7889040];
    NSLog(@"currenet:%@",[locmanager location]);
   
     //关键就在这里,取得两个cllocation间的距离,单位是m
    NSLog(@"%@",[NSString stringWithFormat:@"%0.2f km",[[locmanager location] distanceFromLocation:newLocation]/1000]);
  
   // CLLocationDistance newDistance = [[locmanager location] distanceFromLocation:newLocation];