iOS initWithCoder/decodeObjectForKey memory leak
<p>The Leaks instrument tells me that I have a memory leak when I use <code>decodeObjectForKey</code> within <code>initWithCoder</code>.    For example:</p>

<pre><code>Class.h
{
MyObject *myObject;
}

@property (nonatomic, retain) MyObject *myObject;

Class.m

@synthesize myObject

-(void)dealloc{
 [myObject release];
 [super release];
}

-(id)initWithCoder:(NSCoder *)decoder{
 if (self = [super init]{
 self.myObject = [decoder decodeObjectForKey:@"MyObject"];
 }
 return self;
}
</code></pre>

<p>Per request in the comments:</p>

<pre><code>-(void)encodeWithCoder:(NSCoder *)encoder{

    [encoder encodeObject:myObject forKey:@"MyObject"];

}
</code></pre>

<p>Leaks reports a leak of type NSCFString on the line;</p>

<pre><code> self.myObject = [decoder decodeObjectForKey:@"MyObject];
</code></pre>

<p>As I understand it, decodeObjectForKey returns an autoreleased object.  Since I immediately assign that value to the myObject property, which is specified as (nontoxic, retain) in the property definition, I retain the autoreleased object through the setter method of the myObject property.  The myObject is then released in the dealloc method.  I don't understand where the leak is if I understand the sequence correctly.  Also why is it reported as a NSCFString when the type is MYObject?</p>

<p>Any thoughts would be appreciated, including if my assumptions above are correct.</p>
