1
我已經閱讀了大量的文章,並通過開發手冊,無法準確找到如何設置CMCalibratedMagneticField,以便獲取數據。爲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.
我知道這可能是一個愚蠢的問題,因爲有文件,但我只是不理解設置的語法。任何幫助將非常感激。