cgimagesourcecreatewithurl pdf

Я пытаюсь загрузить изображения большого пальца в CGPDFDocument. Я написал следующий код в функции с именем "main" в классе "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

любая помощь?? Заранее спасибо.

1 ответ

Решение

Добавить фреймворк ImageIOFramework. В xcode это делается на вкладке настроек проекта: фазы сборки -> связать бинарный файл с библиотеками

Другие вопросы по тегам