私はiPhoneプログラミングが初めてです..次の問題から誰か助けてくれませんか
私は次のコードを使用してzipファイルを解凍しています..動作していません...そしてNSLog(@ "Failure To Unzip Archive");を出力しています。メッセージ
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];
ありがとう....