Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 10th, 2012  |  syntax: None  |  size: 0.40 KB  |  hits: 53  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How Nike  GPS on iPhone receives accelerometer updates in the background?
  2. - (void)startAccelerationCollection
  3. {
  4. [self.motionManager startAccelerometerUpdatesToQueue:[[NSOperationQueue alloc] init]
  5.                                          withHandler:^(CMAccelerometerData *data, NSError *error) {
  6.     dispatch_async(dispatch_get_main_queue(), ^{
  7.     [self.accelerometerReadings addObject:  data];
  8. }
  9. ];
  10. }