title: iphone - NSTimers in background
body: <p>Im developing an app that has to run in the background. It's a location based app, so it runs all the time, the OS doesn't kill it.</p>
  
  <p>It should send some info every 10 secs(just for debugging), I set a timer once its in the background. I set a breakpoint in the function that should be executed every 10 secs, which is never called, but if I pause the app and then continue the timer is called, and then the timer is executed every 10 secs without problems, weird right?</p>
  
  <p>I thought that the timer would be executing anyway when I wasn't debugging, but it isn't, same thing as if I didn't pause the debugging.</p>
  
  <p>My question is WHY?? The timer is set correctly(I assume) since it works after pausing, but it's not.</p>
  
  <p>Any ideas?</p>
  
  <p>The way I set the timer is:</p>
  
  <pre><code>self.timer = [NSTimer scheduledTimerWithTimeInterval:10 target:self selector:@selector(doStuff) userInfo:nil repeats:YES];
  </code></pre>
  
  <p>And in the function I connect to a webservice.</p>
  
  <p>Thanks.</p>