application crashes due to uiimageview
<p>i have application in which i display around 50 images and when i reach to 30th image my application crashes due to memory issues. I have tried all the methods which i know but still problem is not solved. so please help me.</p>

<pre><code>NSLog(@"%d",nn);
nn ++;
NSLog(@"%d",nn);
NSMutableArray* arr2 = [[NSMutableArray alloc]init];
arr2 = [Database executeQuery:@"select * from cartoon"];
if (nn == [arr2 count]) 
{
    nn = 0;
}
NSMutableDictionary*  dict1 = [arr2 objectAtIndex:nn];
NSLog(@"%@",dict1);              
NSString * both_name = [NSString string];
both_name = [both_name stringByAppendingString:[dict1 objectForKey:@"mainpk"]];
both_name = [both_name stringByAppendingFormat:@".  "];
both_name = [both_name stringByAppendingString:[dict1 objectForKey:@"name"]];
NSLog(@"both %@",both_name);
label1.text = both_name;
imgv.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@.jpg",[dict1 objectForKey:@"name"]]];  `
</code></pre>
