UIImageView and UIImage: how can I tune for maximum performance?
First: I am implementing a fairly complex image scrolling mechanism that allows several hundred thousand to scroll (in theory) in a single scroll. This is done by preloading small chunks on scrolling, while reusing all UIImageViews. Currently, all I do is assign the newly created UIImage objects to the reusable UIImageViews.
It might be better if you could reuse these UIImage objects by passing them new image data.
Now the problem is that I am currently using the -imageNamed: method. The documentation says it caches the image.
The problems I see in this case with -imageNamed: Since the image is scrolling from the preload range, it is no longer needed. It would be bad if it was trying to cache thousands of images while the user is scrolling and scrolling and scrolling. And if I found a way to inject the new image data into the UIImage object for reuse, then what happens to the old image that has been cached?
So, one method remains that seems interesting: -initWithContentsOfFile:
It does not cache the image. And it doesn't use -autorelease, which is fine in this case.
Do you think it would be better to use -initWithContentsOfFile: in this case?
a source to share
I found one link regarding this that the comments of the imageNamed method http://www.alexcurylo.com/blog/2009/01/13/imagenamed-is-evil/
a source to share