NSMutableArray release Problem
I am stuck in crashes. I m doing following thing in a function
NSMutableArray *myMutableArray=[[NSMutableArray alloc] initWithCapacity:0]];
for (int i=0;i<10;i++)
[myMutableArray addObject:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"img000%d.png",(start+i+1)] ofType:nil]]];
I have around 50 images and I load only 10 at a time for a purpose, I am controlling this my "start" variable which contains the initial point. And I want to free previous loaded images while loading new ones.
But when I uncomment the release method My program crashes..
And if I do not release My memory is not being freed, as I checked in Instruments, although there is not leak in Leaks but still object allocation goes on and on with overall system memory of 100 MB. And because of this I get Low Memory Warning in program when I test in the device. I don't know what is the problem here. Please let me know if anyone has resolution.
Thanks in advance.