title: Completion Block Not Executing
body: <p>Here is the call with the block:</p>
  
  <pre><code>[VacationHelper openVacationWithName:vacationName
                  usingBlock:^(UIManagedDocument *vacationDocument) {
     NSLog(@"vacationDocument.description:%@", vacationDocument.description);
  }];
  </code></pre>
  
  <p>In the receiving method's .h:</p>
  
  <pre><code>typedef void (^completion_block_t)(UIManagedDocument *vacationDocument);
  </code></pre>
  
  <p>And in the .m:</p>
  
  <pre><code>+ (void)openVacationWithName:(NSString *)vacationName
                    usingBlock:(completion_block_t)completionBlock;
  {
      NSLog(@"Opening Vacation Document");
  
      // Get documents directory and path.
      NSURL *url = [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
      url        = [url URLByAppendingPathComponent:vacationName];
  
      // Create the document and open if a match exists on file.
      UIManagedDocument *vacationDocument = [[UIManagedDocument alloc] initWithFileURL:url];
      if ([[NSFileManager defaultManager] fileExistsAtPath:[url path]]) {
          NSLog(@"vacationDocument.documentState:%i", vacationDocument.documentState);
          [vacationDocument openWithCompletionHandler:^(BOOL success) {
              if (success) NSLog(@"Document was opened.");
              else NSLog (@"Couldn't open document at %@", url);
          }];
      } else {
  
          // No match exists, so save the document to file.
          [vacationDocument saveToURL:url forSaveOperation:UIDocumentSaveForCreating
                    completionHandler:^(BOOL success) {
                        if (success) NSLog(@"Document was created.");
                        else NSLog(@"Couldn't create document at %@", url);
                    }];
      }
      NSLog(@"Exiting helper.");
  }
  </code></pre>
  
  <p>My question is why does execution not reach the block passed in the call to <code>openVacationWithName:</code>?  I never see the NSLog written.</p>
  
  <p>I suspect that <code>openVacationWithName:</code> doesn't finish, but the NSLog for "Exiting helper." does print.  Any guidance appreciated.  FYI this is for iTunes U/Stanford CS193P assignment #6.</p>