Quote:
Originally Posted by man2manno
Hey guys, I have a question about the getDistanceFrom!
after about 3 seconds the distance label displays a number like "2333.34 m" which is obviously not right due to the fact I have not moved the iphone
Anyone got an idea of why it is doing that?
Thanks a lot.
|
My understanding is that
Code:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
is event driven and is only called again when the location has changed enough to fire another event. When you first start updating the location, it appears that the event fires once (3 seconds after starting) to give you the current location. So newLocation would be the current location, and oldLocation would be the previous (different) location, not necessarily the last time the method was called, but the previous time the device's internal location was updated by a significant-enough change in location.