I'm trying to calculate the distance between two places user Core Location. I've found a few posts that state to use
-(CLLocationDistance)distanceFromLocation:(const CLLocation *)location
Found some other test code in the thread below:
CLLocationDistance NaN
I'm no开发者_开发问答t sure how to put it all together, to get the result I want ?
Anyone any thoughts ?
Regards, Stephen
If you have a location named myLocation
and want to find the distance from another location, say, restaurantLocation
, then it seems you would do something like
CLLocationDistance distance = [myLocation distanceFromLocation:restaurantLocation]
This will give you the distance, in meters, between the two.
精彩评论