我可以使用核心运动框架的这种方法:

- (void)startAccelerometerUpdatesToQueue:(NSOperationQueue *)queue withHandler:(CMAccelerometerHandler)handler
.

作为的替代品

- (void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration
.

UIAccelerationDelegate方法的uikit。在那里,我必须指定更新的频率。我想尽可能快速准确地获得加速数据。

是我的朋友的核心运动吗?什么是我可以期待核心运动方法的读数的频率?文档不谈论它。

有帮助吗?

解决方案

Edit! Now that this answer is OVER A YEAR OLD, certainly it is only of historic value. At this stage, I guess, everyone should only be using CoreMotion and that's that. Hope this historic answer it helps an history students!


My impression is that: CMAttitude and CMDeviceMotion give you the benefit of both the accel'r and the gyro (if the gyro is present). Whereas CMAccelerometerData is only the accel'r. (Exactly like in the old days before Core Motion.)

My impression is that the two specific advantages of CoreMotion are:

(One) the mindboggling convenience of having Quaternions and attitude given to you on a silver platter

(Two) apparently, both gyro and accel'r are used on machines with a gyro, with no extra work from you ... a huge advantage.

I believe there is no actual technical difference in the quality of usage of the accelerometer per se.

Thus: if (for some reason) you want only the accel'r, and you can do the math (if relevant to your task at hand), you could use the old-school accel'r delegate.

It seems that in short, none of us will ever again use the old-school accelerometer delegate!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top