title: NSKeyedUnarchiver not behaving as expected
body: <p>I have come across an odd behaviour in NSKeyedUnarchiver.</p>
  
  <p>I archive a data, for this example I just use a string:</p>
  
  <pre><code>NSMutableData       *myData = [ NSMutableData data ];
  NSKeyedArchiver     *archiver = [[ NSKeyedArchiver alloc ] initForWritingWithMutableData:myData ];
  NSString            *testString = [ NSString stringWithString:@"Hello World!" ];
  [ archiver encodeObject:testString forKey:@"test" ];
  [ archiver finishEncoding ];
  </code></pre>
  
  <p>and then I want to unarchive it. if I use </p>
  
  <pre><code>NSKeyedUnarchiver  *unarchiver = [ NSKeyedUnarchiver unarchiveObjectWithData:myData ];
  NSString     *result = [ unarchiver decodeObjectForKey:@"test" ];
  </code></pre>
  
  <p>I get nil result, but if I use:</p>
  
  <pre><code>NSKeyedUnarchiver  *unarchiver = [[ NSKeyedUnarchiver alloc ] initForReadingWithData:myData ];
  NSString     *result = [ unarchiver decodeObjectForKey:@"test" ];
  </code></pre>
  
  <p>I get my string back. Now I thought that [ NSKeyedUnarchiver unarchiveObjectWithData:myData ] is just a convenience method for [[ NSKeyedUnarchiver alloc ] initForReadingWithData:myData ], but it does not seem to behave in that way. Am I wrong.</p>
  
  <p>Thanks
  Reza</p>