0
我使用儀器檢測我的程序,下面的代碼檢測到內存泄漏 期待您的幫助,謝謝!iOS:將照片保存到文件夾時出現內存溢出
int count =(int)array.count;
for (int i=0; i<count; i++) {
set=(ALAsset *)[array objectAtIndex:i];
CGImageRef ref1= [set thumbnail];
CGImageRef ref=[[set defaultRepresentation] fullResolutionImage];
NSData * imagedata2=[[NSData alloc]init];
imagedata2=UIImageJPEGRepresentation([[UIImage alloc]initWithCGImage:ref],1);
// CGImageRelease(ref);
NSString * photoNmaeOgiginal=[NSString stringWithFormat:@"%@_origianl.jpg",uuid];
NSString *PhtotoOriginalPath=[AlbumFolderPath stringByAppendingPathComponent:photoNmaeOgiginal ];
BOOL resultOriginal= [NSData writeToFile:PhtotoOriginalPath atomically:YES];
}