我正在使用ChuteSDK从照片库中导入多个图像,如下所示:
-(void)doneSelected{
NSMutableArray *returnArray = [NSMutableArray array];
[self showHUD];
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^(void){
for(id object in [self selectedAssets]){
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
if([object isKindOfClass:[GCAsset class]]){
ALAsset *asset = [object alAsset];
NSMutableDictionary* temp = [NSMutableDictionary dictionary];
[temp setObject:[[asset defaultRepresentation] UTI] forKey:UIImagePickerControllerMediaType];
[temp setObject:[UIImage imageWithCGImage:[[asset defaultRepresentation] fullScreenImage] scale:1 orientation:(UIImageOrientation)[[asset defaultRepresentation] orientation]] forKey:UIImagePickerControllerOriginalImage];
[temp setObject:[[asset defaultRepresentation] url] forKey:UIImagePickerControllerReferenceURL];
[returnArray addObject:temp];
}
[pool release];
}
dispatch_async(dispatch_get_main_queue(), ^(void) {
if(delegate && [delegate respondsToSelector:@selector(PhotoPickerPlusController:didFinishPickingArrayOfMediaWithInfo:)])
[delegate PhotoPickerPlusController:[self P3] didFinishPickingArrayOfMediaWithInfo:returnArray];
[self hideHUD];
});
});
}
但是fullScreenImage
给了我原始图像的缩小版本,如果我使用fullResolutionImage
它会导致low memory warning
应用程序崩溃的问题。
如何在不引起内存问题的情况下获得原始分辨率的图像。
PS:我没有ARC
在我的项目中使用。