title: How to Execute a task continuously when application is in Background state in iOS 8
body: <p>I Write the below code for executing a task when application is in background state it is working fine in iOS 7 but it is not working in iOS 8.
  Can someone give me solution to execute a task continuously in iOS 8 when application is in background state.</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application 
  {
     UIApplication *app = [UIApplication sharedApplication];
     UIBackgroundTaskIdentifier bgTask;
     bgTask = [app beginBackgroundTaskWithExpirationHandler:^{
          [app endBackgroundTask:bgTask];
     }];
  }
  </code></pre>