To expand slightly on rokjarc's comment:
UIImage +imageNamed:
explicitly caches. The documentation states:
This method looks in the system caches for an image object with the specified name and returns that object if it exists. If a matching image object is not already in the cache, this method loads the image data from the specified file, caches it, and then returns the resulting object.
So images loaded previously will remain in the cache unless or until the memory is needed elsewhere. There's no efficiency to be gained from freeing memory up needlessly.
If you want to avoid the caching for whatever reason — I would argue whatever spurious reason — you could use +imageWithContentsOfFile:
, or the normal init
equivalent, having obtained the full path from NSBundle
.
PNGs set to image views and other places via the interface builder will be accessed via the cache as far as I'm aware.