tags:

views:

67

answers:

1

Hy

I have to put a lot of images (>100) to a UIView, with touch detection. If I use UIImageViewController I have ran out of memory. I've tried to draw the images manually, but in that case I can't detect wich image has been pushed.

So how would you do this?

A: 

For a simple solution, you might want to try creating thumbnail sized images to display that will take up much less memory (100 times 32 pixels x 32 pixels x 4 channels is definitely small enough for the iPhone to handle). For a more robust solution, you want to look at doing lazy loading and only keep in memory those images that are currently being displayed. There is a great example of this in a CoverFlow clone found in Ch 12 of iPhone SDK Application Development, which you can see here

jeff7
Yepp, that could be work, if I don't want to zoom the images. :( So the thumbnail is unfortunately not a great option, and the lazy loading is fail, since I have to display every image. (in a 0.4 zoomed scrollView for example).
MetaImi