I am considering using sprites for an image heavy game.
I’m trying to determine whether any extra memory is allocated when sharing a single UIImage between image views. I ran a test by creating 40 image views, once with a single image and once by creating 40 image instances and they appeared to use the same amount of memory.
If extra memory is allocated per image view using a single image, what’s the use of using sprites?
I believe I’ve just answered my own question. It appears the memory allocations for both tests are the same because I was using imageNamed: to load the images. And as noted here: Dispelling the UIImage imageNamed: FUD
I reran the test using imageWithContentsOfFile: and found that no extra memory was allocated when sharing the same UIImage.