title: moving a function to a background thread in objective c
body: <p>I have a function that returns a string that takes 15 seconds to compute on an iPhone. </p>
  
  <p>I want to be able to run the function on the background thread so that the main thread can be used for the user interface.</p>
  
  <p>I've heard <code>GCD</code> is a new technology that is good for this, can someone provide some example code in regards to how this would work?</p>
  
  <p>That is to run a generic function on the background thread and return the result to a UI text field.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Thanks Alladinian it works a treat. </p>
  
  <p>However, when I use GCD my function takes 1 second longer to execute on the iphone simulator (I'd guess this'd be about 5 seconds on an iphone (ill have to test it later today to be sure))</p>
  
  <p>Is there any reason why this is? Perhaps the background thread is slower or something?</p>