views:

70

answers:

1

I currently have a UIScrollView which has a content size equal to about 50 pages, each one the size of the application view.
I have implemented scrolling by using paging and at all time keep current, previous and next page in memory, while the rest are created when required, e.g. when one swipes forward, the old 'previous' view is released and a new 'next' view is loaded.

The new pages are loaded and old released when 'scrollViewDidEndDeaccelerate' is called.

The disadvantage with this is of course that the page needs to settle completely before a new page swipe may begin.

Is there a more efficient way of doing this with a different type of control? UITableView?

I am looking for solutions with other type of controls - not UIScrollView implementations with e.g. placeholder images and loading high res on demand.

A: 

Sounds like you are on the right track as predictive caching is about the only idea I can offer...which you are doing. Maybe checking available memory and loading to a certain percentage of that might help, with caveat that you monitor the low memory warning and dump items that are the farthest from the current view location.

Kenny
Does it use extra memory, the fact that the UIScrollView's contentSize is huge even though no content is actually placed in it?
LK
The size of the content view does not necessarily mean larger memory size. This value is (without knowing Apples implementation) used for layout and is just a value. To prove it to yourself, try setting it to a ludicrous value (say 321,473,320 <- That's quite ludicrous!) and then check your memory consumption using your favorite method.
Kenny