iphone - Best Practice to Hold UIImage's in NSMutableArray -


i have lot of uiimage's need hold in memory during 1 particular action.

the best way managed hold images convert them nsdata , store in nsmutablearray. later loop through array , convert nsdata uiimage objects again reuse each image (i merge them 1 single piece).

however, if there 10 or more images in array app crashes. saving them hard drive instead of nsmutablearray add lot of processing time user.

what's best practice handle large amount of images on fly?

you find can store more images in array before crashing if store uiimage directly. costs memory convert nsdata uiimage , back.

however, still have limited memory. if these images can change in size, number can have in array before crashing unknown. if case, might time start looking @ caching data tmp folder.

regardless, best practice hold references objects directly in array rather convert them nsdata. storing direct references allows reference counting work magic, requiring less copying of data in memory, reducing memory footprint , improving performance.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -