CMMagnetometerData Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Framework/CoreMotion.framework |
| Availability | Available in iOS 5.0 and later. |
| Declared in | CMMagnetometer.h |
Overview
Instances of the CMMagnetometerData class encapsulated measurements of the magnetic field made by the device’s magnetometer.
Your application can obtain samples of magnetometer measurements, as represented by instances of this class, from the block handler of the startMagnetometerUpdatesToQueue:withHandler: method or from the magnetometerData property of the CMMotionManager class.
Properties
magneticField
Returns the magnetic field measured by the magnetometer. (read-only)
Discussion
The value of this property is the total magnetic field observed by the device which is equal to the Earth’s geomagnetic field plus bias introduced from the device itself and its surroundings.
This is the “raw” magnetic-field value, unlike the calibrated value of the magneticField property of CMDeviceMotion which filters out the bias introduced by the device and, in some cases, its surrounding fields.
Availability
- Available in iOS 5.0 and later.
Declared In
CMMagnetometer.hConstants
CMMagneticField
A structure containing 3-axis magnetometer data
typedef struct {
double x;
double y;
double z;
} CMMagneticField;
Fields
xX-axis magnetic field in microteslas.
yY-axis magnetic field in microteslas.
zZ-axis magnetic field in microteslas.
Availability
- Available in iOS 5.0 and later.
Declared In
CMMagnetometer.h© 2011 Apple Inc. All Rights Reserved. (Last updated: 2011-10-12)