Place Images out of NSMutableArray on UIView?
I have开发者_如何学C an array of multiple images which I want to display on my screen (2 Columns, 4 Rows). If there are more than 8 Images in the row, than a new view should be created. Can someone please point me in the correct direction how to handle this?
Thanks for any feedback!
BR,
Stefan
This is a very generic question. Have you consider keeping your model in the app delegate which stores the full instance of the NSMutableArray. And then create a convenience method in your model that will query for up to 8 images from a particular index?
Your UIViewController should then be initialized with a particular index and access the model to get up to 8 images back from the model, returned in an NSArray. And your UIViewController can then display up to those 8 images, checking the size of the NSArray returned.
Also you might want to consider just storing an Array of NSURLs to these images and load them only when that particular UIViewController gets those arrays. This will limit your memory footprint by a whole lot.
Hope that helps.
精彩评论