2012-07-26 37 views
0

我想在CGPDFDocument 加載拇指圖片我寫一個函數下面的代碼稱爲「主」類「ReaderThumbFetch」cgimagesourcecreatewithurl PDF

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 

任何幫助? 謝謝先進。

回答

5

添加框架ImageIOFramework。 在xcode中它是在項目設置選項卡中完成的:構建階段 - >鏈接庫與二進制文件

+0

感謝您的幫助,它修復:) – user1553381 2012-08-05 18:15:01