title: Apple Watch: Why the APP forced to stop when using CMSensorRecorder?
body: <p>I used <a href="https://developer.apple.com/library/ios/documentation/CoreMotion/Reference/CMSensorRecorder_class/#//apple_ref/doc/uid/TP40016255-CH1-SW7" rel="nofollow noreferrer">CMSensorRecorder</a> to record historical Accelerometer data, and <em>accelerometerData(from:to:)</em> to retrieve past data. But if I record 1 hour or more, the APP always forced stop when <strong>retrieving</strong>, I can hardly receive data of that time.</p>
  
  <p>When <strong>Recording</strong>, everything is okay like Pic1, while press "Stop" to <strong>Retrieve data</strong>, it became like Pic2. <strong>The Question is</strong>: if I want to record a long time data, the Pic2 will continues very long and mostly cause the APP shutdown! Then nearly all data will lose! </p>
  
  <p><a href="https://i.stack.imgur.com/NAn3m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NAn3m.png" alt="Recording"></a> &amp; <a href="https://i.stack.imgur.com/MclLf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MclLf.png" alt="Retrieving"></a></p>
  
  <p>My code below:</p>
  
  <pre><code>if CMSensorRecorder.isAccelerometerRecordingAvailable(){
      Now = NSDate()
      recorder.recordAccelerometerForDuration(time)
      print("\n\n\nRecording Accel!...........\n")
  }else{
      print("Need Authorization to record!...\n")
      self.EatingButton.setTitle("AuthFail")
  }
  // retrieve data from watch
  let sensorDataList = recorder.accelerometerDataFromDate(Now, toDate: NSDate())
  if (sensorDataList == nil){
     SButton.setTitle("Failed")
  }else{
     for data in sensorDataList!
     {
        //Send data to iPhone
        self.sendAccel("\(data.startDate) \(data.acceleration.x) \(data.acceleration.y) \(data.acceleration.z)")
     }
  }
  </code></pre>
  
  <p>Anyone can help me?</p>
  
  <p>Whether there are some relationship to <strong>NSProcessInfo</strong> function?</p>