Skip to content

Instantly share code, notes, and snippets.

@yeahq
Created April 15, 2012 10:04
Show Gist options
  • Save yeahq/2391659 to your computer and use it in GitHub Desktop.
Save yeahq/2391659 to your computer and use it in GitHub Desktop.
Downloding zip and extracting in main bundle subdirectory at runtime
//http://stackoverflow.com/questions/5385480/iphone-downloding-zip-and-extracting-in-main-bundle-subdirectory-at-runtime
NSString *filepath = [[NSBundle mainBundle] pathForResource:@"ZipFileName" ofType:@"zip"];
ZipArchive *zipArchive = [[ZipArchive alloc] init];
[zipArchive UnzipOpenFile:filepath Password:@"xxxxxx"];
[zipArchive UnzipFileTo:{pathToDirectory} overWrite:YES];
[zipArchive UnzipCloseFile];
[zipArchive release];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment