我一直在使用此代码获得膨胀错误-3。我尝试过不同版本的libz。我试过了libz.dylib
,我尝试了libz.1.2.5.dylib
有什么建议吗?
NSData *originalData = [@"Look out! It's..." dataUsingEncoding:NSUTF8StringEncoding];
//use Godzippa to compressed
NSData *compressedData = [originalData dataByGZipCompressingWithError:nil];
//use ObjectiveZlib to decompressed
NSData *decompressedData = [NSData dataByDecompressingData:compressedData];
修改的
我在一个新项目中工作了。现在我需要解压缩从php web服务器收到的gz文件。我从dataByDecompressingData:] [Line 94] inflate error: -3
NSData *originalData = [@"Look out! It's..." dataUsingEncoding:NSUTF8StringEncoding];
// use ObjectiveZlib to compress
NSData *compressedData2 = [NSData dataByCompressingData:originalData];
//use ObjectiveZlib to decompressed
NSData *decompressedData2 = [NSData dataByDecompressingData:compressedData];
NSLog(@"%@", [NSString stringWithUTF8String:[decompressedData2 bytes]]);