1

I have local database which has the field "distance" which is based on user's current location. so i have added a logic to update database if there is change in location for every 30sec.

If there is change in the location one time in 30 sec its working fine, but when the device location changes to more to one location within 30 sec, database updated distance is changing.

Can you please let me know whats the mistake i have done here.

sKhan
  • 9,694
  • 16
  • 55
  • 53
  • Add some code of **update distance**..? – Kumar KL Jul 01 '13 at 06:08
  • And define in what way it's an error, if it just overwrites the distance for each update in the 30 seconds is that an error? – Wain Jul 01 '13 at 06:10
  • Cllocation *dblocation; double distance = [dblocation distanceFromLocation:currentLocation]/1000 – sKhan Jul 01 '13 at 07:03
  • in database i have a field called distance, whenever there is change in location database will be updated by calculating the distance of the object in database with current location. My problem is: If i change the location to Delhi with in 30sec it works fine, where as if the change location to 1.delhi then again 2. mumbai , database will be updated with the result by merging delhi and mumbai results – sKhan Jul 01 '13 at 07:05
  • actually its merging the result of previous locations, i,e number of location change it merging the results. – sKhan Jul 01 '13 at 07:13

0 Answers0