How to manage memory on iPhone when handling many images -


I have a unique problem in the project that I am working on. What I'm doing is the "wall" of scrolling images that are downloaded from the server that our users can flick on the iPhone but the problem is that we are having trouble with a good memory management plan here. The one we are currently running is a class that subclasses UIImageView, which is being used to store every image we download from the server (these images are of the app Documents are saved in the directory), and then we also add it to meta data (i.e. details, tags, etc.). We are then storing it in an NSMutableArray, after which we loop through all the pictures to move them into our wall. As you imagine, all of these images have a heavy memory hog in memory without this memory we are having a hard time trying to do this one of the biggest difficulties is that it Need to report the images being made that are made more difficult when being touched. So I do not think we can delegate them by putting them. Do any of you have the experience of handling any kind of items in such a large size and have to hand them in order to draw for the screen, play, etc.? What type of technique or approach do you suggest? I have read about CoreData, but I do not know what it is that I see.

The main drawing method for the solution is:

Solution: WWDC session video # 104!

In fact, what you want, they come and go, Removal is a system.

A simple example that you should see before the photos app on your iPhone, though you may have one million images on your "wall", you can see so many images on your screen at the same time You can. This means that you do not need one lakh UIImageView for all the pictures on the wall, just fit 20 or so on the screen.

Think of the wall that there is not a big scene that is available at all time, but rather than the pattern set by UITableView, follow UITableView as the AUTABLE VALU they disappear and (hopefully) The data source reconnects those table cells again by changing the information displayed in the decay and one in the new row.

You should not have problems reporting any problem that has touched the image (since you can see only what image is included in the image view, or some other saved property).

The above principles should also be applied to UIImages themselves; Since you are saving them to disk, you must remember that they are all in memory, so think about releasing them and taking on demand. One thing to note: Sometimes scrolling gives you very slow speed when you are reading pictures from a disk, so it is a tradeoff that you will need to check yourself.


Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -