Hi all.....
i am new to iPhone programming..can anybody help me out from the following problem
i am using the fallowing code to unarcive a zip file.. its not working... and printing the NSLog(@"Failure To Unzip Archive"); msg
self.fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory , NSUserDomainMask, YES);
self.documentsDir = [paths objectAtIndex:0];
NSString *filePath = [NSString stringWithFormat:@"%@/temp", self.documentsDir];
NSString *updateURL = [[[NSBundle mainBundle]resourcePath] stringByAppendingPathComponent:@"bmlgg.zip"];
NSLog(@"Checking update at : %@", updateURL);
NSLog(@"Checking filepath at : %@", filePath);
ZipArchive *zipArchive = [[ZipArchive alloc] init];
if([zipArchive UnzipOpenFile:updateURL]) {
if ([zipArchive UnzipFileTo:filePath overWrite:YES]) {
//unzipped successfully
NSLog(@"Archive unzip Success");
//[self.fileManager removeItemAtPath:filePath error:NULL];
} else {
NSLog(@"Failure To Unzip Archive");
}
} else {
NSLog(@"Failure To Open Archive");
}
[zipArchive release];
thank u....