作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
在装有 iOS 10.0.2 的 iPhone 6 上,我收到以下代码的错误:
class ViewController: UIViewController {
@IBOutlet weak var startStop: UIButton!
var isRunning = false
let manager: CMMotionManager = {
let manager = CMMotionManager()
manager.deviceMotionUpdateInterval = 1/100
return manager
}()
@IBAction func handleStartStop(_ sender: AnyObject) {
if isRunning {
stopMotionUpdates()
startStop.setTitle("Start", for: .normal)
} else {
startMotionUpdates()
startStop.setTitle("Stop", for: .normal)
}
isRunning = !isRunning
}
func startMotionUpdates() {
manager.startDeviceMotionUpdates(using: .xTrueNorthZVertical, to: .main) { (data, error) in
print("Roll: \(data!.attitude.roll), Pitch: \(data!.attitude.pitch), Yaw: \(data!.attitude.yaw)")
}
}
func stopMotionUpdates() {
manager.stopDeviceMotionUpdates()
}
}
输出:
2016-10-19 07:45:13.865847 CoreMotionTest[562:350766] CoreLocation: CPAS data response was invaild.
Roll: -0.0135864792263794, Pitch: 0.00864587532420694, Yaw: 6.47493275587377e-05
Roll: -0.0135915108585011, Pitch: 0.00865699352311076, Yaw: 7.09129926643357e-05
Roll: -0.0135963930210582, Pitch: 0.00867386848019366, Yaw: 8.84424471509634e-05
Roll: -0.0136066048134502, Pitch: 0.00868011794373523, Yaw: 0.000105925819254466
Roll: -0.0136114190872102, Pitch: 0.00867577431915433, Yaw: 0.000117932969705823
Roll: -0.0135948730328641, Pitch: 0.00867657982050841, Yaw: 0.00012968687069689
Roll: -0.0135732480451522, Pitch: 0.00867729811777266, Yaw: 0.000152007924023406
Roll: -0.0135619969691634, Pitch: 0.00868342424259059, Yaw: 0.000163872505991956
Roll: -0.013304139897602, Pitch: 0.00874500976978164, Yaw: 0.000179014630004322
Roll: -0.0133409772363028, Pitch: 0.00887204866716325, Yaw: 0.00018600114405152
Roll: -0.0130968013066843, Pitch: 0.00890815168076916, Yaw: 0.000201127439543817
Roll: -0.0129980717242318, Pitch: 0.00898203106432451, Yaw: 0.00022290167061286
Roll: -0.013058759809209, Pitch: 0.008972000868579, Yaw: 0.000240753238817741
Roll: -0.0130954579972119, Pitch: 0.0089717830946822, Yaw: 0.000258417382421598
知道这是什么意思吗?
最佳答案
与使用指南针的要求有关。 xMagneticNorthZVertical 会导致它,而 xArbitraryZVertical 不会。
关于ios - 核心位置 : CPAS data response was invaild,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40117938/
所以我得到的是一个小验证器,如果使用此检查器在输入中输入任何受限制的符号,它会显示带有错误的标签: var ValidPattern = /^[a-zA-Z0-9а-яА-Я\-.": ]*$/; 问
写iOS字符串字面量时,遇到一个奇怪的问题。是无效的通用字符。代码如下: NSString *str = @"\ud83d\udc4d"; // Prompt error: Invaild unive
在装有 iOS 10.0.2 的 iPhone 6 上,我收到以下代码的错误: class ViewController: UIViewController { @IBOutlet weak
我是一名优秀的程序员,十分优秀!