Would the code bellow cause my code to leak? More specifically, am I responsible for releasing the newImage
or the contents of mainPageLayer
(which is a CALayer
object)? I get a memory warning every 4th time that method is called, but cant figure out why...
I also can't figure out why mainPageLayer.contents = [newImage CGImage];
throws a warning that the argument I am passing is of an incompatible pointer time. The image shows up just fine inside the layer.
-(void)setPrimaryPage:(UIImage *)newImage {
pImageSizeWidth = newImage.size.width;
pImageSizeHeight = newImage.size.height;
[mainPageLayer setFrame:CGRectMake(0, 0, pImageSizeWidth, pImageSizeHeight)];
mainPageLayer.contents = [newImage CGImage];
}