i want to know that how to find the distance between from current location to another plz help me
A:
There is a method to find the distance between two CLLocations.
CLLocationDistance distance = [firstLocation getDistanceFrom:secondLocation];
Anil Sivadas
2010-09-14 14:25:55
This method has been deprecated since 3.2.
Gidogeek
2010-09-14 14:57:22
+4
A:
CLLocation *location = [[CLLocation alloc] initWithLatitude:doubleLattitude longitude:doubleLongitude];
double distanceDouble;
if([user_Location respondsToSelector:@selector(distanceFromLocation:)])
distanceDouble = [user_Location distanceFromLocation:location];
else
distanceDouble = [user_Location getDistanceFrom:location];
This way you support both OS 4.0 and 3.0 since getDistanceFrom is depricated now.
In the above example user_Location is also a CLLocation object.
Gidogeek
2010-09-14 14:30:21