人々、
iOSアプリのsqliteデータベースをZipするにはどうすればよいですか?クラウドでsincしようとしているのですが、問題が発生しています...
zipするために使用するクラスはどれですか?私を助けてください!
人々、
iOSアプリのsqliteデータベースをZipするにはどうすればよいですか?クラウドでsincしようとしているのですが、問題が発生しています...
zipするために使用するクラスはどれですか?私を助けてください!
ZipArchiveを使用して、zip/unzipするObjectiveCラッパーを使用できます-http: //code.google.com/p/ziparchive/
zipの場合:-
NSArray* paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString* dPath = [paths objectAtIndex:0];
NSString* txtfile = [dPath stringByAppendingPathComponent:@"test.txt"];
NSString* zipfile = [dPath stringByAppendingPathComponent:@"test.zip"];
ZipArchive* zip = [[ZipArchive alloc] init];
BOOL ret = [zip CreateZipFile2:zipfile];
ret = [zip addFileToZip:txtfile newname:@"test.txt"];//zip
if( ![zip CloseZipFile2] )
{
zipfile = @"";
}
[zip release];
NSLog(@"The file has been zipped");
http://code.google.com/p/objective-zip/で入手できるZlibを使用できます。