Skip to content
Godzippa! - GZip Compression / Decompression Category for NSData
Objective-C Ruby
Find file
Latest commit 0fea316 Jan 18, 2015 @mattt Updating copyright year
Failed to load latest commit information.
Example Refactoring tests Nov 24, 2014
Godzippa.xcworkspace Squashed commit of the following: Nov 24, 2014
Godzippa Updating copyright year Jan 18, 2015
Tests Refactoring tests Nov 24, 2014
Godzippa.podspec Bumping version to 1.1.0 Nov 24, 2014
LICENSE Initial import Mar 11, 2012


gzip Compression / Decompression Category for NSData & NSFileManager

Example Usage


NSData *originalData = [@"Look out! It's..." dataUsingEncoding:NSUTF8StringEncoding];
NSData *compressedData = [originalData dataByGZipCompressingWithError:nil];
NSData *decompressedData = [compressedData dataByGZipDecompressingDataWithError:nil];
NSLog(@"%@ %@", [NSString stringWithUTF8String:[decompressedData bytes]], @"Godzippa!");


NSFileManager *fileManager = [NSFileManager defaultManager];
NSURL *file = [NSURL fileURLWithPath:@"/path/to/file.txt"];
NSError *error = nil;

[fileManager GZipCompressFile:file
        writingContentsToFile:[file URLByAppendingPathExtension:@"gz"]


  • zlib - In the "Link Binary With Libraries" Build Phase of your Target, add libz.dylib


Mattt Thompson


Godzippa! is available under the MIT license. See the LICENSE file for more info.

Something went wrong with that request. Please try again.