title: iOS: Memory Management in UIScrollView with many UIViewControllers
body: <p>i've got a question regarding a UIScrollView with paging enabled that contains many UIView, each managed by an own UIViewController.</p>
  
  <p>Right now there are about 20 to 30 UIViewControllers that COULD be contained in the UIScrollView. It's a catalog app on the iPad, and I started preloading all the views at the beginning, but with the amount of UIViewControllers getting bigger and bigger, that is not an option any more.</p>
  
  <p>I'm looking for the perfect solution in terms of memory usage. It's no problem to reload the UIViewControllers when the ContentOffset of the ScrollView reaches a specific controller. And I think to nil the UIViewControllers when the ContentOffset tells me that the UIViewControllers is not needed any more isn't that hard as well.</p>
  
  <p>What is the correct way to handle this? Is it enough to alloc the UIViewControllers when needed, putting them into a NSMutableDictionary or NSMutableArray and nil them when they are not needed any more? A little bit of help from someone already having done something similar would be great!</p>
  
  <p>Thanks for your help!</p>