Currently I'm able to get updates from the accelerometer using CMAccelerometer
_motionManager.accelerometerUpdateInterval = kUpdateInterval;
[_motionManager startAccelerometerUpdatesToQueue:self.queue withHandler:
^(CMAccelerometerData *accelerometerData, NSError *error) {
[(id) self setAcceleration:accelerometerData.acceleration];
[self performSelectorOnMainThread:@selector(update) withObject:nil waitUntilDone:NO];
}];
- (void)update {
... code to handle data ...
}
And this is working fine, however when I close my app (i.e. put it into the background not kill the instance), I no longer receive updates from my _motionManager. How do I handle this?