Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone - single UIImage multiple UIImageView?

I have a single image that needs to be placed on multiple UIImageView.

I am wondering whether there is a way to save the memory in doing this?

For e.g., I have a pic file. I can create one UIImage object for this file. If I create multiple UIImageView and init them with the single UIImage Object, will that save the memory?

thanks

like image 250
Jack Avatar asked Oct 01 '10 08:10

Jack


1 Answers

Yes, it will save memory compared to one UIImage per UIImageView. How significant will it be? To find out, you'll have to run it both ways and watch the memory allocations by Instruments.

like image 159
John Franklin Avatar answered Nov 05 '22 17:11

John Franklin