Hey I am trying to get distance from my current location to another location. But while trying to do so I have been stuck for last 5 hrs. Heres what I am doing and am unable to figure why am I getting an error here:
CLLocation *myloc=[[CLLocation alloc]initWithLatitude:locationManager.location.coordinate.latitude longitude:locationManager.location.coordinate.longitude];
CLLocationDistance dince = [myloc distanceFromLocation:location];
I have searched it all over the net and everyone is using the same lines, but to me it says incompatible type for argument. Can someone please tell me what is wrong here?
For the benefit of future readers, I’ll point out that the problem was that
-distanceFromLocation:expects its parameter to be aCLLocation*, not aCLLocationCoordinate2D.