Hello,
I'm having a problem with getDistanceFrom and distanceFromLocation. getDistanceFrom is deprecated iOS 4.1 and distanceFromLocation is not available in 3.1.3, how do I get around this problem.
Has anyone else come across this problem ?
My code at the moment is:
CLLocationDistance kilometers;
if ([currentLocation respondsToSelector: @selector(distanceFromLocation:)])
{
kilometers = [currentLocation distanceFromLocation:previousLocation] / 1000;
}
else
{
//kilometers = [currentLocation getDistanceFrom:previousLocation] / 1000;
kilometers = [currentLocation performSelector: @selector(getDistanceFrom:) withObject: previousLocation] / 1000;
}
Depending on which iOS I compile with I'm getting 'invalid operands to binary' on the lines:
kilometers = [currentLocation distanceFromLocation:previousLocation] / 1000;
kilometers = [currentLocation performSelector: @selector(getDistanceFrom:) withObject: previousLocation] / 1000;
Regards, Stephen