title: how to check an dispatch_async block has finished running
body: <p>So basically I need to be able to run a segue after a block has finished running. I have a block which does some JSON stuff and I need to know when that has finished running. </p>
  
  <p>I have a queue which I have called json_queue. </p>
  
  <pre><code>jsonQueue = dispatch_queue_create("com.jaboston.jsonQueue", NULL);
  </code></pre>
  
  <p>I then have a dispatch_async block with this syntax:</p>
  
  <pre><code>  dispatch_async(jsonQueue, ^{
    [self doSomeJSON];
    [self performSegueWithIdentifier:@"modaltomenu" sender:self];
    });
  </code></pre>
  
  <p>It wont let me perform the line: "[self performSegueWithIdentifier:@"modaltomenu" sender:self];" </p>
  
  <p>Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...</p>
  
  <p>Where can I check to find out when the thread has done its dirty work so i can call the segue? </p>
  
  <p>Thankyou lovely people.</p>
  
  <p>PS: beer and ups and teddy bears and flowers to whoever can help &lt;3. </p>