Unpacking a file on a device

The following team worked great on Simulator. But this command does not work on devices.

#define kUnZipCommand @"unzip \"%@\" -d\"%@\""
NSString *anUnZipCommand = [NSString stringWithFormat:kUnZipCommand, aFileName, aDirectoryPath];       
system([anUnZipCommand UTF8String]);   

Any idea?

+3
source share
3 answers

Call is system()not supported on the device due to the sandbox. To process Zip files you need to link to library .

+8
source

You will need to use a framework like ZipKit .

+3
source

I used NuZipin the past. You call it the same way you could call unzip on the command line:

[NuZip unzip:@"MyArchive.zip -d my_directory"];
+2
source

Source: https://habr.com/ru/post/1787768/


All Articles