title: Schedule re-occuing task whilst in background state. (iOS)
body: <p>If my research is correct when your application is in the background it is really suspended. Apple supported methods for background task are location, audio, &amp; SIP type applications is this correct? </p>
  
  <p>Is there any Apple supported methods for running a method every 60 seconds whilst in background, I need to check the status of a server. The following code does what I need but stops after 10mins which I believe is another Apple supported method. Any suggestions or confirmation as to whether this is or is not possible would be helpful.</p>
  
  <p>The code below just creates a task that runs every 10 seconds and updates the badge count.</p>
  
  <p>Regards</p>
  
  <pre><code>- (void)viewDidLoad
  {
      [super viewDidLoad];
  
      count=0;
      counterTask = [[UIApplication sharedApplication]
                     beginBackgroundTaskWithExpirationHandler:^{
                         // If you're worried about exceeding 10 minutes, handle it here
                    }];
      theTimer=[NSTimer scheduledTimerWithTimeInterval:5
                                               target:self
                                             selector:@selector(countUp)
                                              userInfo:nil
                                              repeats:YES];
  }
  
  - (void)countUp {
      NSLog(@"%s - %d", __FUNCTION__, count + 1 );
  
      if (count==1000) {
          [theTimer invalidate];
          [theTimer release];
          [[UIApplication sharedApplication] endBackgroundTask:counterTask];
      } else {
          count++;
          NSString *currentCount;
          currentCount=[[NSString alloc] initWithFormat:@"%d",count];
           [currentCount release];
          [UIApplication sharedApplication].applicationIconBadgeNumber = count;
  
      }
  }
  </code></pre>