here the CLLocationManager class provides another location field, such as latitude, longitude, accuracy and speed.
I use CoreLocationController , so to update the location I call this method below you can get the current speed in - (void) locationUpdate: (CLLocation *) location , as shown below.
- (void)locationUpdate:(CLLocation *)location { NSString *currentspeed = [NSString stringWithFormat:@"SPEED: %f", [location speed]]; }
or else, the delegate method
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSLog(@"in update to location"); NSString *currentspeed = [NSString stringWithFormat:@"SPEED: %f", [newLocation speed]]; }
also you can get an example from this link ... http://www.vellios.com/2010/08/16/core-location-gps-tutorial/
Hope this helps you ... :)
source share