質問

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?

役に立ちましたか?

解決 2

Adding CoreGraphics framework resolves my problem.

他のヒント

You need to add QuartzCore.framework to your project so that the code links. This API is part of QuartzCore framework in iOS. Also, where using it, use #import <QuartzCore/QuartzCore.h>

Hope that helps!

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top