title: Storing NSManagedObject in a dictionary (NSDictionary)
body: <p>I have a custom class, which is a subclass of <code>NSManagedObject</code>. I would like to store it in a dictionary, but when trying to do so I receive a <code>Property list invalid for format: 200</code> error.</p>
  
  <p>Here is how I try to create the dictionary:</p>
  
  <pre><code>NSDictionary *dictionary = 
      [NSDictionary dictionaryWithObject: voiceMemo forKey:@"voiceMemo"];
  </code></pre>
  
  <p>Same result when trying</p>
  
  <pre><code>NSDictionary *dictionary = 
      [NSDictionary dictionaryWithObject: (NSData *) voiceMemo forKey:@"voiceMemo"];
  </code></pre>
  
  <p>It works, however, when trying to save the individual attributes separately:</p>
  
  <pre><code>NSDictionary *dictionary = 
      [NSDictionary dictionaryWithObject: voiceMemo.attribute forKey:@"attribute"];
  </code></pre>
  
  <p><code>NSDictionary</code> should be able to store data objects, so I'm guessing, the real question is how to cast an <code>NSManagedObject</code> object to <code>NSData</code></p>