I am building an app which downloads a bunch of data from a zip file. I downloaded the zipfile but want to extract the catalog which is a pdf file. I am using SSZipArchive but my code isn't working. I guess I'm not unzipping it correctly.
My code:
[data writeToFile:filePath atomically:YES];
// Unzipping
NSString *destinationPath = [documentsDir stringByAppendingPathComponent:@"catalogus"];;
[SSZipArchive unzipFileAtPath:filePath toDestination:destinationPath];
[[NSUserDefaults standardUserDefaults] setValue:destinationPath forKey:@"catalogus"];
And in another viewcontroller I want to open the pdf
NSString *bestand = [[NSUserDefaults standardUserDefaults] valueForKey:@"catalogus"];
ReaderDocument *testdocument = [ReaderDocument withDocumentFilePath:bestand password:phrase];
When i download the pdf directly (not zipped at all) my code works fine.