Monday 15 September 2014

iphone - Not able to unzip folder objective c -


I'm using Object-Zip for zip / unzip files in the folder.

The folder is completely pinned, but I am not able to open it. Here's my code.

  - (zero) makeUnZip {NSString * stringPath1 = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0]; NSString * stringpath = [string path 1 stringbapping path comparison: [@ "test" stringbifting format: @ ".zip"]]; Zipfile * unzipFile = [[zipfile light] initWithFileName: stringpath mode: zipfilemodeUnzip]; NSArray * infos = [unzipFile listFileInZipInfos]; (Nssting * file in infos) {zip reedstream * puddstream = [unzipfile readcurrent file enzip]; FileInZipInfo * fileInfo = [unzipFile getCurrentFileInZipInfo]; NSString * fileName = [fileInfo name]; NSLog (@ "file name ---% @", filename); NSString * unzipFilePath = [String Path 1 StringBappingPath Component: Filename]; NSString * dir = [unzipFilePath stringByDeletingLastPathComponent]; If (! [[NSFileManager defaultManager] fileExistsAtPath: dir isDirectory: zero]) {[[NSFileManager default manager] createDirectoryAtPath: dir attributes: zero]; NSLog (@ "created directory% @", DIR); }} [UnzipFile close]; }   

NSLog shows only one filename for all the files and the zipped file in my directory directory is not being unzipped.

For example, 3 images in zip folder are abc1.png, abc2.png and abc3.png Then NSLog shows abc3.png for all three and do not open it.

When I am unzipping manually by going to the simulator folder

Can anyone see it and tell me where I am wrong?

Finally I did it

Objective - Not enough help for zip Thank you Kirti Mali and Vijay for comment.

No comments:

Post a Comment