UScrollView lazy loading unload view
I have a question regarding the page control sample code from apple.
in the sc开发者_C百科rollViewDidScroll
method there's a comment:
// A possible optimization would be to unload the views+controllers which are no longer visible
I wonder how to unload the views+controllers. As I have problems with my memory management I really need that.
Hope anyone can help.
From your scrollViewDidScroll
you could figure out the current coordinates the user is in from the contentSize
with this as the user scrolls out a certain viewController
pop that viewController
or view
from of the current view.
[currentView removeFromSubView];
You could do this but I would suggest you try to use UITableView
as this is all damn easy to do it there...
精彩评论