distanceFromLocation - Calculate distance between two points

后端 未结 7 1079
礼貌的吻别
礼貌的吻别 2020-11-29 21:27

Just a quick question on Core Location, I\'m trying to calculate the distance between two points, code is below:

    -(void)locationChange:(CLLocation *)newL         


        
7条回答
  •  庸人自扰
    2020-11-29 21:30

    Try this instead:

    CLLocationDistance meters = [newLocation distanceFromLocation:oldLocation];
    

    The method you're trying to use is a method on a CLLocation object :)

提交回复
热议问题