0

に親指の画像を読み込もうとしていますCGPDFDocumentmainクラスで呼び出される関数で次のコードを記述しました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
4

1 に答える 1

5

フレームワークImageIOFrameworkを追加します。xcodeでは、プロジェクト設定タブで実行されます。ビルドフェーズ->バイナリとライブラリのリンク

于 2012-08-05T16:04:59.953 に答える