我不断收到此代码的膨胀错误-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]]);