In my iPad app at one moment I load 100 images from Photo Stream using ALAsset and following code:
ALAsset *asset = [assets objectAtIndex:[sender tag]];
ALAssetRepresentation *representation = [asset defaultRepresentation];
UIImage *image = [[UIImage alloc] initWithCGImage:[representation fullScreenImage]
scale:1.0f
orientation:0];
And everything works perfectly. But when I cache it to the file system as JPEG files, and then load them again with UIImage *image = [UIImage imageWithContentsOfFile:fullPath]
, application crashes with Memory Warning, and I can see in the profiler that it really uses a lot of RAM.
Why is this happening?
Ok, it was my bad. I found the problem, and it comes out that I have memory problems in any case.
ALAsset
andimageWithContentsOfFile
are working exactly the same.Now I will try to find the way to reduce each image's size.