I am developing a photo gallery application using AssetsLibrary to upload photos of my device. When you present a random image in another VC, I noticed the following: an imageView image is loaded for my full image image (the path is much longer than the native photosApp), and I also get memory from the "Received" log after loading several images. If I install my presentation on fullScreenImage, the warnings will stop, but I donβt want it What should I change to ensure smooth performance and high-quality images on the screen?
Here is the code, hope you can tell me what the problem is:
This is VC where I want to present my image on the screen
- (void)viewDidLoad { [super viewDidLoad]; NSLog(@"%@",assetsController); detailImageView = [[UIImageView alloc]initWithFrame:self.view.bounds]; [self.view addSubview:detailImageView]; detailImageView.image = smallImage;
UPDATE 1
{ UIImageView *detailImageView = [[UIImageView alloc]initWithFrame:self.view.bounds]; [self.view addSubview:detailImageView]; detailImageView.image = smallImage; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^{ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; ALAsset *asset = [assetsController.albumPics objectAtIndex:assetsController.index]; ALAssetRepresentation *representation = [asset defaultRepresentation]; UIImage *bigImage = [UIImage imageWithCGImage:[representation fullResolutionImage]]; dispatch_async(dispatch_get_main_queue(), ^{ detailImageView.image = bigImage; }); [pool release]; }); }

source share