ios - didUpdateToLocation called twice, ok. Why is oldLocation nil both times? -
i understand cllocationmanager called twice on init in cases, once cached location data, , once updated content.
this makes sense, when returns same result in both cases (eg: because simulated location returns same coord , accuracy).
here log startup process. didupdatetolocation called twice, both times oldlocation nil:
// setup code: let locationmanager = cllocationmanager() locationmanager.delegate = self locationmanager.distancefilter = 100.0 locationmanager.requestwheninuseauthorization() locationmanager.startupdatinglocation() // log output: locationmanager didupdatetolocation old: nil new: <+22.28468100,+114.15817700> +/- 5.00m (speed -1.00 mps / course -1.00) @ 6/25/15, 3:21:57 pm indochina time locationmanager didupdatetolocation old: nil new: <+22.28468100,+114.15817700> +/- 5.00m (speed -1.00 mps / course -1.00) @ 6/25/15, 3:22:01 pm indochina time
what doesn't make sense oldlocation
nil in these cases. have provide external variable call actualoldlocation
keep track of change in distance between updates. doing wrong causes value nil?
what ios targeting? didupdatetolocation deprecated ios 6.0, not sure works nowadays.
Comments
Post a Comment