如何计算iPhone上的车速

时间:2011-08-30 01:24:42

标签: iphone objective-c

我想在iPhone上实时显示汽车的速度。我可以用什么?

不使用gps计算汽车的速度需要几秒钟?

2 个答案:

答案 0 :(得分:1)

我有一个名为Speedometer和Map的应用程序。我使用Core Location来确定用户的位置,他们每英里移动的距离,然后我将此数字转换为小时,并不断更新。希望这有帮助!

答案 1 :(得分:1)

如果您实现符合CLLocationManagerDelegate协议的类,并将其实例设置为delegate对象的CLLocationManager,则您的对象将收到-locationManager:didUpdateToLocation:fromLocation:致电-[CLLocationManager startUpdatingLocation]后的消息。您通过该方法收到的CLLocation对象具有speed属性,该属性是设备的速度,以米/秒为单位。更新频率可以通过CLLocationManager的{​​{1}}和distanceFilter属性进行控制。