【发布时间】:2014-01-07 06:37:01
【问题描述】:
当从 MPMoviePlayerController 中获取缩略图并且应用程序崩溃时收到“收到内存警告”。
我正在使用代码:
dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(void){
for (int i = 0; i < pickedVideoAssetDuration; i ++){
UIImage *singleFrameImage = [movie thumbnailImageAtTime:i timeOption:MPMovieTimeOptionExact];
CGSize newSize = CGSizeMake(50, 50);
// checks whether the thumbnails are properly extracted or not
UIGraphicsBeginImageContextWithOptions(newSize, NO, 0.0f);
[singleFrameImage drawInRect:CGRectMake(0,0,newSize.width,newSize.height)];
UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();
NSLog(@"newSize >60 : %@", NSStringFromCGSize(newImage.size));
UIGraphicsEndImageContext();
// checks whether the thumbnails are properly extracted or not
if(newImage)
[durationArray addObject:newImage];
else
NSLog(@"nil thumbnail");
dispatch_async(dispatch_get_main_queue(), ^{
[self designthumbScroll:thumbImageCount];
});
}}
如果有任何帮助将不胜感激:)
【问题讨论】:
-
请把警告放在这里..
-
“收到内存警告”
标签: ios memory-management ios7