Can't find the memory leak
I've got a fairly simple app that has the following in the mostly used view:<br>
	int currentPageIndex;<br>
	NSArray *images;<br>
	NSString *nextImage;<br>	
	IBOutlet UIImageView *firstPage;<br>
	IBOutlet UIButton *bigButton;	

In the implementation viewDidLoad, I load the array with a bunch of image file names:<br>
	images = [NSArray arrayWithObjects:@"image1.jpg", @"image2.jpg", etc, nil];<br>
	[images retain];

Each time the bigButton is tapped, the image changes:

- (IBAction)bigButtonTapped:(id)sender {<br>
	currentPageIndex++;
	
	nextImage = [images objectAtIndex:currentPageIndex];<br>
	firstPage.image = [UIImage imageNamed:nextImage];<br>
}

Everything works as I want it to, except that I am getting a "Received memory warning. Level=1" in the console with my device plugged in. This warning comes up after every 12 images or so, and eventually it crashes with "EXC_BAD_ACCESS"

It is a very simple app so I'm sure the fix is very simple... any ideas what I might be overlooking?   Thanks so much!!



Can't find the memory leak
===

I've got a fairly simple app that has the following in the mostly used view:<br>
	int currentPageIndex;<br>
	NSArray *images;<br>
	NSString *nextImage;<br>	
	IBOutlet UIImageView *firstPage;<br>
	IBOutlet UIButton *bigButton;	

In the implementation viewDidLoad, I load the array with a bunch of image file names:<br>
	images = [NSArray arrayWithObjects:@"image1.jpg", @"image2.jpg", etc, nil];<br>
	[images retain];

Each time the bigButton is tapped, the image changes:

- (IBAction)bigButtonTapped:(id)sender {<br>
	currentPageIndex++;
	
	nextImage = [images objectAtIndex:currentPageIndex];<br>
	firstPage.image = [UIImage imageNamed:nextImage];<br>
}

Everything works as I want it to, except that I am getting a "Received memory warning. Level=1" in the console with my device plugged in. This warning comes up after every 12 images or so, and eventually it crashes with "EXC_BAD_ACCESS"

It is a very simple app so I'm sure the fix is very simple... any ideas what I might be overlooking?   Thanks so much!!


