2013-09-16 49 views
0

當我建立這個代碼,我得到一個錯誤,CGImageRelease錯誤i386硬件架構

AVAsset *asset = [AVAsset assetWithURL:ur]; 
AVAssetImageGenerator *imageGenerator = [[AVAssetImageGenerator alloc]initWithAsset:asset]; 
CMTime time = CMTimeMake(2, 1); 
CGImageRef imageRef = [imageGenerator copyCGImageAtTime:time actualTime:NULL error:NULL]; 
UIImage *thumbnail = [UIImage imageWithCGImage:imageRef]; 

cell.imageView.image=thumbnail; 
CGImageRelease(imageRef); 

錯誤

Undefined symbols for architecture i386: "_CGImageRelease", referenced from:  
ld: symbol(s) not found for architecture i386 
clang: error: linker command failed with exit code 1 (use -v to see invocation) 

我已經加入libc++.dylib但仍錯誤仍然存​​在。我該如何解決這個問題?

回答

0

加入CoreGraphics框架解決了我的問題。

0

您需要將QuartzCore.framework添加到您的項目中,以便代碼鏈接。這個API是iOS中的QuartzCore框架的一部分。此外,在使用它的地方,請使用#import <QuartzCore/QuartzCore.h>

希望有所幫助!

+0

我認爲這是OS-X框架。當我嘗試添加時,它在IOS中不可用。 – Boggarapu

+0

@Boggarapu是的,你是對的。檢查我的編輯 – Amar

+0

仍然有相同的錯誤發生。沒有使用添加'quartzcore.framework' – Boggarapu

相關問題