title: CMPedometer queryPedometerDataFromDate returns error 103
body: <p>I'm trying to do a query to the pedometer cache on an iPhone 6 with iOS 8.1.2, I'm using objective-c, I have imported CoreMotion framework and included it in the project the code looks like this</p>
  
  <pre><code>NSDate *startDate = [[NSDate date] dateByAddingTimeInterval:-60*60*12];
  NSDate *endDate = [NSDate date];
  CMPedometer *pedo = [[CMPedometer alloc]init];
  [pedo queryPedometerDataFromDate:startDate toDate:endDate withHandler:^(CMPedometerData *pedometerData, NSError *error)
   {
       if (error)
       {
           NSLog(@"error: %@", error);
       }
  }];
  </code></pre>
  
  <p>This gives me the error: Error Domain=CMErrorDomain Code=103 "The operation couldn’t be completed. (CMErrorDomain error 103.)" </p>
  
  <p>If I do the exact same thing in Swift like this</p>
  
  <pre><code>var dateString = "2014-12-15"
      var dateFormatter = NSDateFormatter()
      dateFormatter.dateFormat = "YYYY-MM-DD"
  
      var startDate = dateFormatter.dateFromString(dateString)
      var endDate = NSDate()
  
      pedometer.queryPedometerDataFromDate(startDate, toDate: endDate){
          (data, error) -&gt; Void in
          if error != nil
          {
              println("There was an error requesting data from the pedometer: \(error)")
          }
          else
          {
              println(data)
          }
      }
  </code></pre>
  
  <p>I get the pedometer data and no errors.</p>
  
  <p>In both cases I accept the popup telling me to accept the tracking physical activity.
  I have double checked that the app has read access to physical activity data under anonymity settings.</p>
  
  <p>Can anyone explain what I'm doing wrong ?</p>