Is there a practical way to compress NSData?
问题 I haven't seen any documentation on the topic, but that doesn't mean it doesn't exist. 回答1: Yes, compress the data with zlib. @Brad Larson posted on this: see here and added the code as well. There is a CocoaPod which uses Objective-Zip by flyingdolphinstudio. 回答2: Following @Zaph & @Brad Larson's posts, below are the 2 methods gzipInflate and gzipDeflate that work just fine to compress/decompress NSData . (code reformatted from cocoadev.com/wiki/NSDataCategory #import "zlib.h" // don't