Memory Management in Objective-C when dealing with NSMutableArray
<p>In Instruments the tempPlayer object is showing a leak. In this code, in every for loop I keep on allocating a new tempPlayer instance, set its playerCode variable with a string and add it to an NSMutableArray in each iteration. Instruments shows me a leak in the alloc statement. Is there any way to prevent tat leak in the tempPlayer object ?</p>

<pre><code> for(int i = 0 ; i &lt; [homeLineupArray count] ; i++) {   
    NSArray * tildeSeperator = [[homeLineupArray objectAtIndex:i] componentsSeparatedByString:@"~"];

    [self.tempPlayer release];
    self.tempPlayer = [[LineUpsPlayer alloc] init];
    tempPlayer.playerCode = [tildeSeperator objectAtIndex:0];

    [matchLineUp.homeTeamPlayingEleven addObject:tempPlayer ];
}
</code></pre>

<p>Thanks
Harikant Jammi</p>
