title: How to check if UIManagedDocument is empty
body: <p>When a UIManagedDocument instance is opened (document state is normal?), how to check if a UIManagedDocument is empty? By "empty" here means no entity in the document at all.</p>
  
  <p>Or could I just check the emptiness when it is still closed? </p>
  
  <pre><code>if (self.photoDatabase.documentState == UIDocumentStateClosed) 
  { 
      [self.photoDatabase openWithCompletionHandler:^(BOOL success) {}];
      [self setupFetchedResultsController];  
  
      if ( // check if document is empty  )
          {  
              [self fetchFlickrDatatoDocument:self.photoDatabase]; 
          }
  }
  </code></pre>