我正在尝试将拇指图像加载到CGPDFDocument
. main
我在 class中调用的函数中编写了以下代码ReaderThumbFetch
。
NSURL *thumbURL = [self thumbFileURL];
CGImageRef imageRef = NULL;
CGImageSourceRef loadRef = CGImageSourceCreateWithURL((CFURLRef)thumbURL, NULL);
if (loadRef != NULL) // Load the existing thumb image
{
imageRef = CGImageSourceCreateImageAtIndex(loadRef, 0, NULL); // Load it
CFRelease(loadRef); // Release CGImageSource reference
}
函数的实现thumbFileURL
是:
- (NSURL *)thumbFileURL
{
#ifdef DEBUGX
NSLog(@"%s", __FUNCTION__);
#endif
NSString *cachePath = [ReaderThumbCache thumbCachePathForGUID:request.guid]; // Thumb cache path
NSString *fileName = [NSString stringWithFormat:@"%@.png", request.thumbName]; // Thumb file name
return [NSURL fileURLWithPath:[cachePath stringByAppendingPathComponent:fileName]]; // File URL
}
但是当我运行它给我以下错误:
Undefined symbols for architecture i386:
"_CGImageSourceCreateWithURL", referenced from:
-[ReaderThumbFetch main] in ReaderThumbFetch.o