title: about enqueuing by using completion blocks
body: <p>So, after learning about completion blocks a while back, I like using completion blocks a lot.  I like closure and I like the ability to pass just about anything anywhere I want.</p>
  
  <p>As someone who's new to thread programming, I've been staying away from GCD and NSOperation--but lately I've had to program asynchronous updated to Core Data stuff and I am beginning to have doubts to my "all completion block all the time" approach.</p>
  
  <p>So here's one example of what I'm questioning myself: I have a series of potentially rather large data (images, sound, video, what have you) to upload to a server somewhere.  The metadata for these data is stored in Core Data, and I have a timestamp that I use to decide which objects should get uploaded.  All these uploads should be done sequentially.</p>
  
  <p>What I have coded is a essentially basically just a function with a completion block in it, that has a call to itself at the end of the block, like this:</p>
  
  <pre><code>(void)uploadAllAsynchronously {
    ... // First figure out what to upload based on core data
    // Here comes the completion block in question
    void(^blk)(BOOL) = ^(BOOL)uploadSuccess {
      ... // if upload successful, update core data to mark what has been uploaded
      [self uploadAllAsynchronously]; // Recursively calls the function that contains this block.  I actually have a weak self, or if that fails to break a retain cycle, I should be able to pass in a NSManagedObjectContext as an argument.
    }
    [NSURLConnection sendAsynchronousRequest:... queue:... completionHandler:blk];
  
  
  }
  </code></pre>
  
  <p>This should work, right?  Is there something here that is completely dangerous that suggests I have to use GCD and handling my own queue?  I am asking this because I'm kind of having some trouble right now possibly with data in it would appear different threads not updating correctly because of asynchronous calls, though not sure which part of my code is the culprit.</p>
  
  <p>Thanks in advance.</p>