Memory management and performance
<p>If I allocate an object in a method, 'getASprocket' and call it this way, will there be a leak here?</p>

<pre><code>Sprocket *sprock = [Sprocket getASprocket];

// store this returned value as an ivar
ivarSprock = [sprock retain];

// release the originally acquired object
[sprock release];
</code></pre>

<p>The Sprocket object is allocated and returned this way:</p>

<pre><code>– (Sprocket *)getASprocket {
    Sprocket *sprocket;

    sprocket = [[Sprocket alloc] init];

    return [sprocket retain];
}
</code></pre>

<p>Also, would changing from <code>'[sprocket retain];'</code> inside the 'aSprocket' method to <code>'return [sprocket autorelease];'</code> make worse performance hit?</p>
