This repository has been archived by the owner on Apr 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 553
High memory problems caused flash back in iPad #183
Comments
[self.imageManager requestImageForAsset:asset
targetSize:targetSize
contentMode:PHImageContentModeAspectFill
options:nil
resultHandler:^(UIImage *result, NSDictionary *info) {
if (cell.tag == indexPath.item)
{
cell.imageView.image = result;
}
}]; [self.imageManager startCachingImagesForAssets:assetsToStartCaching
targetSize:targetSize
contentMode:PHImageContentModeAspectFill
options:nil]; I found two methods above consume more memory using Instruments. |
I fixed this issue with delivery mode option. If you set delivery mode as PHImageRequestOptionsDeliveryModeOpportunistic, memory problem fixes. Example of code: PHImageRequestOptions *imageRequestOptions = [PHImageRequestOptions new];
imageRequestOptions.synchronous = YES;
imageRequestOptions.networkAccessAllowed = YES;
imageRequestOptions.deliveryMode = PHImageRequestOptionsDeliveryModeOpportunistic;
[self.imageManager requestImageForAsset:asset
targetSize:targetSize
contentMode:PHImageContentModeAspectFill
options: imageRequestOptions
resultHandler:^(UIImage *result, NSDictionary *info) {
if (cell.tag == indexPath.item)
{
cell.imageView.image = result;
}
}];> |
Cool! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am using QBImagePicker in my project, I works well and it was very good before.
Preconditions:Just to see the album, not other operations
Recently, the QA test found a high memory problem:
I check on code and log, it show me this is not crash and I found received a lot of high memory warning than flash back.
Note:
allowsCachingHighQualityImages
ofPHCachingImageManager
to NO, but still received memory warning.Now, Can I get some help? Thanks very much.
The text was updated successfully, but these errors were encountered: