tags:

views:

94

answers:

1

Hello everybody,

i am developing a GPS application in which i needs to track the speed of the device/iphone ,i am using the CLCorelocation API's Locate me referral code provided by Apple my problem is that the LocationManager does not updates the current latitude and longitudes thus i am unable to calculate the distance as well as the speed of the device/iphone. Any kinds of suggestions/code will be highly appreciated please suggest me if i can do something with the Mapkit framework introduced in the sdk 3.0.

thanks in advance

A: 

Check out apple's Core Location Framework Reference.

By implementing the CLLocationManagerDelegate method locationManager:didUpdateToLocation:fromLocation: you can receive latitude and longitude updates from your CLLocationManager.

Also, since you're wanting to check the device's speed you'll probably want to set the distanceFilter and desiredAccuracy of your CLLocationManager to kCLDistanceFilterNone and kCLLocationAccuracyBest respectively.

If you can get yourself a copy, Beginning iPhone Development has a chapter (#14) dedicated to using CoreLocation that I found beneficial. Lastly, although it is not focused on CoreLocation, Apple's tutorial on CoreData incorporates CoreLocation data which you may find useful.

Edit: Related question specific to calculating speed.

Eric de Araujo