i\'m changing image of UIImageview by [self setImage: newImage];
Looks like every time I does that with newImage, prior image doesn\'t seem to be released.
Wha
Yes UIImageView setImage indeed leaks!
If you cycle through a bunch of images with
[yourImageView setImage:[UIImage imageNamed:@"sampleImage.png"]];
you can see on instruments memory usage increasing. This seems to be some kind of caching going around since after cycling through all the images memory usage will go flat.
The correct, or at least, the non leaky way to do it is:
NSString *thePath = [[NSBundle mainBundle] pathForResource:@"sampleImage" ofType:@"png"];
UIImage *newImage = [[UIImage alloc] initWithContentsOfFile:thePath];
[yourImageView setImage:newImage];
I verified this on my code as my APP was cycling through a lot of large image files.