Created
January 9, 2011 14:27
Revisions
-
rjregenold revised this gist
Jan 9, 2011 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,6 +15,10 @@ - (void)inflateArchive { [pool drain]; } - (void)inflateComplete { // do something after inflate finishes. } # pragma mark - # pragma mark ZKArchive delegate methods -
rjregenold revised this gist
Jan 9, 2011 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ - (void)inflateArchive { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *archivePath = [self archivePath]; ZKFileArchive *archive = [ZKFileArchive archiveWithArchivePath:archivePath]; [archive setDelegate:self]; [self setArchiveSize:[[[archive centralDirectory] valueForKeyPath:@"@sum.uncompressedSize"] unsignedLongValue]]; -
rjregenold created this gist
Jan 9, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ - (void)inflateArchive { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; ZKFileArchive *archive = [ZKFileArchive archiveWithArchivePath:archivePath]; [archive setDelegate:self]; [self setArchiveSize:[[[archive centralDirectory] valueForKeyPath:@"@sum.uncompressedSize"] unsignedLongValue]]; [archive inflateToDiskUsingResourceFork:NO]; // do something with inflated archive. // zipkit puts all inflated files in the same directory as the archive. [self performSelectorOnMainThread:@selector(inflateComplete) withObject:nil waitUntilDone:NO]; [pool drain]; } # pragma mark - # pragma mark ZKArchive delegate methods - (void)onZKArchive:(ZKArchive *) archive didUpdateBytesWritten:(unsigned long long)byteCount { [self setArchiveProgress:[self archiveProgress] + byteCount]; if ([self archiveSize] <= 0) return; [[self progressView] setProgress:(float)[self archiveProgress] / (float)[self archiveSize]]; } - (BOOL)zkDelegateWantsSizes { return YES; }