gpt4 book ai didi

ios - CLLocation 时间戳始终为零

转载 作者:行者123 更新时间:2023-11-30 11:22:28 64 4
gpt4 key购买 nike

在 iPhone 6+、IOS 11.4、Xcode 9.4.1 上,CLLocation 时间戳始终为零。

纬度:30.598748经度:-97.820877海拔高度:308.921658H准确度:10.000000V精度:4.000000时间戳:0.000000 <======

是否有一些设置可以为我提供准确的时间戳?这是打印它的代码:

print("Latitude: \(String(format: "%.6f", location.coordinate.latitude))")
print("Longitude: \(String(format: "%.6f", location.coordinate.longitude))")
print("Altitude: \(String(format: "%.6f", location.altitude))")
print("HAccuracy: \(String(format: "%.6f", location.horizontalAccuracy))")
print("VAccuracy: \(String(format: "%.6f", location.verticalAccuracy))")
print("Timestamp: \(String(format: "%.6f", location.timestamp as CVarArg))")

最佳答案

时间戳Date类型的对象。它应该打印如下:

print("Timestamp: \(String(format: "%@", location.timestamp))")

关于ios - CLLocation 时间戳始终为零,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51125828/

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