iPhone image app not releasing memory as in instruments using imageNamed

Posted by Tankista on Stack Overflow See other posts from Stack Overflow or by Tankista
Published on 2010-04-08T21:49:16Z Indexed on 2010/04/08 21:53 UTC
Read the original article Hit count: 396

hi, im building iPhone app that downloads images (UIImageView) from internet and adding them to UIScrollView. This scroll view could contain 20 or more UIImageViews. Iam adding UIImages to UIImageView like this:

UIImageView *newView = [[UIImageView alloc] initWithImage: image];

Then I just scroll these images like in photo app. Problem is, when I put just 3 UIImageViews in UIScrollView everything works fine, but when I put more images, more memory is used, so that app can crash after 15 or more images. I can understand it that more images alloc more memory, but in Instruments i get allocated max 2-3 MB, but in device memory raises until it crashes. When I use simulator for OS 3.0 i can see memory rising like on device. On higher versions I dont see this memory raise, why is that?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiimageview