0

When I build this code I am getting an error,

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);

Error

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)

I have added libc++.dylib but still error persists. How can I resolve this?

4

2 回答 2

0

添加CoreGraphics框架解决了我的问题。

于 2013-09-18T09:19:05.963 回答
0

您需要添加QuartzCore.framework到您的项目中,以便代码链接。此 API 是 iOS 中 QuartzCore 框架的一部分。另外,在使用它的地方,使用#import <QuartzCore/QuartzCore.h>

希望有帮助!

于 2013-09-16T12:12:35.097 回答