title: CFRunLoopRunInMode freeze in IOS
body: <p>Hello I have a problem with <code>UITableView</code> freeze,</p>
  
  <p>"downloadItem" below gets called when someone clicks on a button on the iPad. Its supposed to download a file and then return. </p>
  
  <p>During the download, while stuck in that function, I want the UI to still be responsive, so I installed a runloop like below.</p>
  
  <p>The actual downloadItem function is WAY more complicated than shown below, but what is shown is the basic idea of it. I know this isn't the best way, but for other reasons, I can't change it at this time, especially due to the existing complexity of the actual function.</p>
  
  <p>The problem is that I also have a <code>UITableView</code> on the screen (as well as the button), if the <code>UITableView</code> is clicked or scrolled while in this function, in the runloop, the <code>UITableView</code> sometimes freezes up, and remains frozen even after exiting this function. This doesn't happen every time for some reason, maybe 40% of the time.</p>
  
  <p>Does anyone know how to fix, is the RunLoop call below done right? Why when I click on the <code>UITableView</code> while in the runloop below, the table sometimes freezes up?</p>
  
  <pre><code>-(IBAction) downloadItem
  {
      BOOL downloading=TRUE;
      callFunctionsToStartdownload(...);
      while (downloading) {
          downloading=DownloadSomeBytes(...);  
          CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, YES);
      }
  }
  </code></pre>
  
  <p>thanks</p>