Class

CMSensorDataList

A list of the accelerometer data recorded by the system.

Declaration

class CMSensorDataList : NSObject

Overview

You do not create instances of this class directly. Instead, you receive one as the result of a query for accelerometer data from a CMSensorRecorder object.

You use a sensor data list object to enumerate over the accelerometer data as shown in Listing 1.

Listing 1

Enumerating over the accelerometer data

-(void)processSamplesFromDate:(NSDate*)start toDate:(NSDate)end {
   CMSensorRecorder* recorder = [[CMSensorRecorder alloc] init];
   CMSensorDataList* list = [recorder accelerometerDataFrom:start to:end];
 
   for (CMRecordedAccelerometerData* data in list) {
      // Process the data.
      NSLog(@"Sample: (%f, %f, %f)", data.acceleration.x,
              data.acceleration.y, data.acceleration.z);
   }
}

Relationships

Inherits From

See Also

Accelerometers

Getting Raw Accelerometer Events

Retrieve data from the onboard accelerometers.

class CMAccelerometerData

A data sample from the device's three accelerometers.

class CMRecordedAccelerometerData

A single piece of accelerometer data that was recorded by the device.

class CMSensorRecorder

The gathering and retrieval of accelerometer data from a device.