title: Application freezes in IOS 10
body: <p>I have developed a application where it uses <strong>GCD</strong> timer and <strong>Sqlite</strong> database it works fine in IOS8 and IOS9 but it fails in IOS10 that it it does not crash but it freezes I am using Xcode 8.1.
  The work flow of the application is when i click on the button timer will start running in background and keep on update the label as well as table list data and inserting the same data to the sqlite database.</p>
  
  <p>Here my problem is when i keep on click the button to update the data it works fine until it insert the 50-60 records after it suddenly freezes and block the UI so to check that i have debug the code I came up with the assumption that it fails because it's blocking the thread but I did not find any solution to resolve it please help me out to resolve my problem thanks in advance.</p>
  
  <p><a href="https://i.stack.imgur.com/mgXDl.png" rel="nofollow noreferrer">Here is the output from my pause:</a></p>
  
  <p><a href="https://i.stack.imgur.com/BMmgG.png" rel="nofollow noreferrer">Error showing after pause and debug:</a></p>
  
  <p>On click of button event I am trying to reload the table and displaying records in it as well as inserting the data to the sqlite database and I have a label which shows the timer data in it.</p>
  
  <pre><code>dispatch_async(dispatch_get_main_queue(), ^{
          self.lbltimer.text = [NSString stringWithFormat:@"%.4f", Timeinterval];
      });
  </code></pre>
  
  <p>Below is my code how I am using GCD timer which runs continuously:</p>
  
  <pre><code>dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
                                      self.aTimer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(ShowTime:) userInfo:nil repeats:YES];      
                                  });
  </code></pre>