Klose
Klose

Reputation: 158

iPhone sdk MapDistance

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

Upvotes: 1

Views: 107

Answers (2)

Ortwin Gentz
Ortwin Gentz

Reputation: 54141

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.

Upvotes: 0

Related Questions