开发者

How to calculate the car speed on iPhone [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
开发者_JAVA技巧

Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist

Closed 9 years ago.

Improve this question

I want to show a car's speeds on iPhone in real time. What can I use?

Wouldn't using gps to calculate the car's speed take many seconds?


I have an app called Speedometer and Map. I use Core Location to figure out where the user is, how far they move every second in miles, and then I convert this number to hours, and update it constantly.


If you implement a class that conforms to the CLLocationManagerDelegate protocol, and set an instance of it as the delegate of a CLLocationManager object, your object will receive -locationManager:didUpdateToLocation:fromLocation: messages after you call -[CLLocationManager startUpdatingLocation]. The CLLocation object you receive via that method has a speed property, which is the speed of the device in meters per second. The frequency of updates can be controlled via CLLocationManager's distanceFilter and desiredAccuracy properties.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜