我已经阅读了很多帖子和开发手册,但无法准确找到如何设置 CMCalibratedMagneticField 以便获取数据。
我在用:
[motionManager startDeviceMotionUpdatesUsingReferenceFrame: CMAttitudeReferenceFrameXMagneticNorthZVertical toQueue: [NSOperationQueue currentQueue] withHandler:^(CMDeviceMotion *motion, NSError *error){
//This is where I don't know how to get the calibrated data but I am trying:
CMCalibratedMagneticField *magfield = motion.magneticField.field;
//then sending it to a function where I pull the x, y, and z values.
我知道这可能是一个愚蠢的问题,因为有文档,但我只是不理解设置的语法。任何帮助将非常感激。