I’ve allocated a UIImageView inside the setBackground method of my tableview cell like this:
[cell setBackgroundView:[[UIImageView alloc]initWithImage:rowBackground]];
When i run Analyse in XCode 4 it highlights this line as a possible memory leak. How do i release this UIImageView as Ive not got a pointer to reference from a release call?
You can either allocate it differently (i.e. store it in an ivar and release that), or call
autoreleaseon it, like this: