I have a zipped file, which i want to extract the contents of it. What is the exact procedure that i should do to achieve it. Is there any framework to unzip the files in co
Here's a more concise version based on codingFriend1's approach
+ (void)unzip {
NSString *targetFolder = @"/tmp/unzipped";
NSString* zipPath = @"/path/to/my.zip";
NSTask *task = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/unzip" arguments:@[@"-o", zipPath, @"-d", targetFolder]];
[task waitUntilExit];
}
-d specifies the destination directory, which will be created by unzip if not existent
-o tells unzip to overwrite existing files (but not to deleted outdated files, so be aware)
There's no error checking and stuff, but it's an easy and quick solution.