1

Can anyone help me "How to calculate distance between two places in MAP(CLLocation).Tell the delegates,methods etc to be used .

Thanks in advance,

BrightRaj

Klose
  • 158
  • 1
  • 1
  • 12

2 Answers2

1

Does this help?

distanceFromLocation - Calculate distance between two points

Community
  • 1
  • 1
Lee Armstrong
  • 11,420
  • 15
  • 74
  • 122
0

You can use this method in CLLocation that takes another CLLocation object and returns the distance in meters:

- (CLLocationDistance)distanceFromLocation:(const CLLocation *)location

Be aware that it's available only in iOS ≥3.2. If you wanna target older iOS versions, use

- (CLLocationDistance)getDistanceFrom:(const CLLocation *)location

This method is marked as deprecated and will disappear at some time in the future.

Ortwin Gentz
  • 52,648
  • 24
  • 135
  • 213