title: UIBackgroundTask not ending
body: <p>I am using UIBackgroundtaskIdentifier to create background task of uploading images to server. </p>
  
  <pre><code>NSLog(@"Time left = %.1f seconds", [UIApplication sharedApplication].backgroundTimeRemaining);
  </code></pre>
  
  <p>When I take the application in to background, it show that applicaiton have 179 seconds to run in background. I log the server responses as it uploads that images one by one.</p>
  
  <pre><code>    [[DataCoordinator sharedInstance] setBackgroundTask:[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{
          NSLog(@"No background task should run now.");
          [[UIApplication sharedApplication] endBackgroundTask:[[DataCoordinator sharedInstance] backgroundTask]];
          [[DataCoordinator sharedInstance] setBackgroundTask:UIBackgroundTaskInvalid];
      }]];
  </code></pre>
  
  <p>The strange thing happening here is that, after the time provided by iOS for my application to run in background is over still the upload doesn't stops. Suppose I tried uploading 33 images, and when 179 seconds got complete application was successful uploading only 9 out of 33 images. But the process doesn't stop. And application keep uploading the remaining pictures.</p>