0

I've a magazine app that downloads PDF in /Library/Caches/... It works pretty well with iOS 7, but from iOS 8 ( that changes file system directories ) I can't open downloaded PDF! from PSPDFKit log error I see:

File downloaded path:

/Users/steven/Library/Developer/CoreSimulator/Devices/xxxxx/data/Containers/Data/Application/xxxxx/Library/Caches/doc1.pdf

PSPDFkit set document from path error:

Error: -[PSPDFGlobalLock documentProviderForDocument:page:]/248 Cannot get document reference, there is no file at /Users/steven/Library/Developer/CoreSimulator/Devices/xxxxx/data/Containers/Bundle/Application/xxxxx/[NAMEAPP]/Users/steven/Library/Developer/CoreSimulator/Devices/xxxxx/data/Containers/Data/Application/xxxx/Library/Caches/doc1.pdf!

Attention: I've replaced some words with xxxx

I'm using an old version of PSPDFKit( i don't known exactly version, I can't find version params )

i get "Caches" folder in this way ( called [Utility documents] in my code ):

NSArray *paths = [[NSArray alloc] initWithArray:NSSearchPathForDirectoriesInDomains( NSCachesDirectory, NSUserDomainMask, YES )];

return [paths objectAtIndex:0];

Download path PDF code:

NSString *destPath = [[Utility documents] stringByAppendingPathComponent:[[highlightedMagazine objectForKey:@"url"] lastPathComponent]];

Read PDF code for iOS 8:

NSString *destPath = [[Utility documents] stringByAppendingPathComponent:[[highlightedMagazine objectForKey:@"url"] lastPathComponent]];

pdfController.document = (PSPDFDocument *)[[Utility documents] stringByAppendingPathComponent:[[highlightedMagazine objectForKey:@"url"] lastPathComponent]];

I see also that download path is "/data/Containers/Data" and read path is "/data/Containers/Bundle", I can't change it.

Can someone help me?? Thank you!

Dharmesh Kheni
  • 71,228
  • 33
  • 160
  • 165
  • so you confirm that is a problem of PSPDFKit lib and not my code? – stefano.v Oct 31 '14 at 07:31
  • I can't confirm it - we didn't test v1 or v2 against iOS 8. – steipete Oct 31 '14 at 12:28
  • ok thank you, but with my current code e new lib my apps will work or i have to change some code to support v4? i wrote to 'sales' last friday, but at time anyone answer to me, can you notify it to your staff? it's urgent! i need to upgrade immediatly! – stefano.v Nov 03 '14 at 14:47
  • I've made sure to expedite this. – steipete Nov 03 '14 at 17:13

0 Answers0