У меня проблема, и я надеюсь, что кто-то может мне помочь.
Я загружаю PDF-файл в DocumentDirectory
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, TRUE);
NSString *documentsDirectory = [paths objectAtIndex:0];
studioPath = [[documentsDirectory stringByAppendingPathComponent:@"test.pdf"] retain];
ASIHTTPRequest *request = [[ASIHTTPRequest requestWithURL:[NSURL URLWithString:@"http://testURL.com/test.pdf"]] retain];
[request setDownloadDestinationPath:studioPath];
, это не весь код, но я надеюсь, вы понимаете, чтоЯ имею в виду.
После этого я покажу этот PDF
CGPDFDocumentRef pdf;
CFStringRef fullPathEscaped = CFURLCreateStringByAddingPercentEscapes(NULL,(CFStringRef)studioPath, NULL, NULL,kCFStringEncodingUTF8);
CFURLRef docUrl = CFURLCreateWithFileSystemPath (NULL, fullPathEscaped, kCFURLPOSIXPathStyle, FALSE);
pdf = CGPDFDocumentCreateWithURL(docUrl);
, но он всегда вылетает, когда я использую интернет-URL вместо studioPath к PDF, он работает, но я бы не стал скачиватьPDF более одного раза.