- How Nike GPS on iPhone receives accelerometer updates in the background?
- - (void)startAccelerationCollection
- {
- [self.motionManager startAccelerometerUpdatesToQueue:[[NSOperationQueue alloc] init]
- withHandler:^(CMAccelerometerData *data, NSError *error) {
- dispatch_async(dispatch_get_main_queue(), ^{
- [self.accelerometerReadings addObject: data];
- }
- ];
- }