Hi,
I googled for the memory issue associated with UIImage and came across many threads talking about the problem but no real help or solution.
I know when we use -imageNamed:
the object is being cached so it's better to use initWithData:
. When we use drawRect:
and UIGraphicsGetImageFromCurrentImageContext()
, does the image goes to cache?
Also in the following code:
CGImageRef tmp = CGImageCreateWithImageInRect(imageToCrop.CGImage, clippedRect); //pull the image from our cropped context UIImage *cropped = [UIImage imageWithCGImage:tmp];//UIGraphicsGetImageFromCurrentImageContext();
CGImageRelease(tmp);
Is caching takes place although there is no reference about this in the documentation? How do we release the memory that is getting consumed by the cache?