title: How do I make my App run an NSTimer in the background?
body: <p>I'm making a benchmark App for test purposes ONLY.  I am not intending this to go to the App Store.</p>
  
  <p>What I need is my NSTimer to continue running on the background using a UIBackgroundTaskIdentifier, save data to a Core Data db and finally push the data to a server (I'm using Parse), after a certain time interval, of course.</p>
  
  <p>So basically, I haven´t found any questions which apply to my specific case.  I set my NSTimer like so:</p>
  
  <pre><code>    UIBackgroundTaskIdentifier bgTask;
  UIApplication  *app = [UIApplication sharedApplication];
  bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
      [app endBackgroundTask:bgTask]; 
  }];
  
  self.timer = [NSTimer scheduledTimerWithTimeInterval:self.localInterval target:self selector:@selector(updateCoreData:) userInfo:nil repeats:YES];
  </code></pre>
  
  <p>the method updateCoreData simply calls the Core Data class and makes the necessary insertions.</p>
  
  <p>I've read about VoIP and the Music playing part, but don't know exactly which one would apply best for my case, nor how to implement them.</p>