I have a .zip folder which contains some images. I want it to unzip into Documents directory in iOS device. I tried with the following link,
download and unzip file in iOS-Stack Overflow Here is the code that I tried in my app,
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask,
YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filepath = [documentsDirectory stringByAppendingPathComponent:@"Obj.zip"];
ZipArchive *zipArchive = [[ZipArchive alloc] init];
[zipArchive UnzipOpenFile:filepath Password:@""];
[zipArchive UnzipFileTo:[documentsDirectory stringByAppendingPathComponent:@"Obj"] overWrite:YES];
[zipArchive UnzipCloseFile];
And then I printed the all files in Document Directory
, but the Obj.zip
is the only file(Obj.zip is the file that wants to unzip) that exist in the Documents Directory. How can I done this?
Thanks in Advance!