How to release it?
<p>I am new to iPhone Development.</p>

<pre><code>+ (id&lt;GMGridViewLayoutStrategy&gt;)strategyFromType:(GMGridViewLayoutStrategyType)type
{
    id&lt;GMGridViewLayoutStrategy&gt; strategy = nil;

    switch (type) {
        case GMGridViewLayoutVertical:
            strategy = [[GMGridViewLayoutVerticalStrategy alloc] init];
            break;
        case GMGridViewLayoutHorizontal:
            strategy = [[GMGridViewLayoutHorizontalStrategy alloc] init];
            break;
        case GMGridViewLayoutHorizontalPagedLTR:
            strategy = [[GMGridViewLayoutHorizontalPagedLTRStrategy alloc] init];
            break;
        case GMGridViewLayoutHorizontalPagedTTB:
            strategy = [[GMGridViewLayoutHorizontalPagedTTBStrategy alloc] init];
            break;
    }

    return strategy;
}
</code></pre>

<p>Here I am calling that method:</p>

<pre><code>gmGridView = [[GMGridView alloc] init];
gmGridView.layoutStrategy = [GMGridViewLayoutStrategyFactory strategyFromType:GMGridViewLayoutHorizontalPagedLTR];
[self.view addSubview:gmGridView];
</code></pre>

<p>Now my question is that how to release strategy object of strategyFromType method?Its giving me potential leak.and if i am going to release/autorelease,my application is crashing.
Please help meThanking you...</p>
