gpt4 book ai didi

ios - CLLocation 没有给出实际速度

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:47:40 26 4
gpt4 key购买 nike

这是我的位置管理器委托(delegate)代码。

当我们使用汽车移动时,它不会给出速度,所以至少速度值应该改变。

它总是给出常量值 -1.00。

-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations
{
CLLocation *crnLoc = [locations lastObject];
self.speedometerCurrentValue=crnLoc.speed;
self.lblSpeed.text=[NSString stringWithFormat:@"%f",crnLoc.speed];
}

最佳答案

请查看苹果解释中的截图。您的速度无效。

enter image description here

关于ios - CLLocation 没有给出实际速度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29006305/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com