<分区>
Possible Duplicate:
How to calculate speed of our car using iphone
如何使用 iPhone 计算我的速度?例如,我可能想在开车时测量汽车的速度。我该如何实现?
<分区>
Possible Duplicate:
How to calculate speed of our car using iphone
如何使用 iPhone 计算我的速度?例如,我可能想在开车时测量汽车的速度。我该如何实现?
最佳答案
尝试这样的事情:
- (id) init
{
self = [super init];
if (self != nil) {
self.manager = [[CLLocationManager alloc] init];
self.manager.delegate = self;
[self.manager startUpdatingLocation];
}
return self;
}
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation
{
NSLog(@"Speed = %f", newLocation.speed);
}
关于iphone - 如何使用 iPhone 计算我的速度?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10566426/