title: Converting a NSObject into NSData
body: <p>I am having an issue in converting a <code>NSObject</code> into <code>NSData</code>. I have a class which inherits <code>NSObject</code>.</p>
  
  <p>When i tried to convert the object of that particular class into <code>NSData</code> as follows :</p>
  
  <pre><code>NSData *dataOnObject = [NSKeyedArchiver archivedDataWithRootObject:classObject];
  </code></pre>
  
  <p>but it gives out exception stating that <code>-[classObject encodeWithCoder:]:</code> unrecognized selector sent to instance ..</p>
  
  <p>I have also added the object to a newly created array as </p>
  
  <pre><code>NSMutableArray *wrapperedData = [NSMutableArray arrayWithObject: classObject];
  NSData *dataOnObject = [NSKeyedArchiver archivedDataWithRootObject:value];
  </code></pre>
  
  <p>But still , its giving out exception. </p>
  
  <p>So I need to extract the bytes from the object <code>classObject</code>. </p>
  
  <p>Any help would be greatly appreciated ...</p>
  
  <p>awaiting for your reply ...</p>