Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 08-02-2009, 07:22 PM   #13 (permalink)
RobS
Registered Member
 
Join Date: Aug 2009
Posts: 2
Default

Quote:
Originally Posted by man2manno View Post
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.

Last edited by RobS; 08-02-2009 at 07:43 PM.
RobS is offline   Reply With Quote
 

» Advertisements
» Online Users: 276
17 members and 259 guests
ADY, aikhan, AppAnnex, astalavista, chemistry, dcool, HemiMG, ilmman, leahov, mer10, NSeven, padsoftware, Paul10, pavanindira, Promo Dispenser, RoryHarvey, touchcream
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,877
Threads: 89,219
Posts: 380,706
Top Poster: BrianSlick (7,129)
Welcome to our newest member, peterkessler45
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:24 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.