I am trying to use a magnetometer:
[myMotionMngr startDeviceMotionUpdatesToQueue: [NSOperationQueue currentQueue]
withHandler:^(CMDeviceMotion *motion, NSError *error)
{
printf("%f\t%f\t%f\n", motion.magneticField.field.x, motion.magneticField.field.y, motion.magneticField.field.z);
CMMagneticFieldCalibrationAccuracy acc = motion.magneticField.accuracy;
}];
And the filed (x, y, z) is always 0. It is
motion.magneticField.accuracyalways CMMagneticFieldCalibrationAccuracyUncalibrated. According to the docs, this means that my device does not have a magnetometer, however this is not the real reason why I am testing iPad2 with iOS 5.0.
What am I missing?
source
share