title: Waiting for multiple blocks to finish
body: <p>I have those methods to retrieve some object information from the internet:</p>
  
  <pre><code>- (void)downloadAppInfo:(void(^)())success
                  failure:(void(^)(NSError *error))failure;
  - (void)getAvailableHosts:(void(^)())success
                    failure:(void(^)(NSError *error))failure;
  - (void)getAvailableServices:(void(^)())success
                       failure:(void(^)(NSError *error))failure;
  - (void)getAvailableActions:(void(^)())success
                      failure:(void(^)(NSError *error))failure;
  </code></pre>
  
  <p>The downloaded stuff gets stored in object properties, so that is why the success functions return nothing.</p>
  
  <p>Now, I want to have one method like this: </p>
  
  <pre><code>- (void)syncEverything:(void(^)())success
                 failure:(void(^)(NSError *error))failure;
  </code></pre>
  
  <p>Which does nothing else than calling all the methods above, and returning only after every single method has performed its success or failure block.</p>
  
  <p>How can I do this?</p>
  
  <p>Hint: I am aware that cascading the methods calls in each others success block would work. But this is neither 'clean' nor helpful when later implementations include further methods.</p>
  
  <p>Attempts:</p>
  
  <p>I tried running each of the calls in an <code>NSOperation</code> and adding those <code>NSOperations</code> to an <code>NSOperationQueue</code> followed by a "completion operation" which depends on every one of the preceding operations.</p>
  
  <p>This won't work. Since the operations are considered completed even before their respective success/failure blocks return.</p>
  
  <p>I also tried using <code>dispatch_group</code>. But it is not clear to me wether I am doing it the right way. Unfortunately, it is not working.</p>