I was wondering if there is a method to zip files without using third party libraries and using only stuff from .
I am attempting to use NSData CompressDataUsingAlgorithm:NSDataCompressionAlgorithmZlib to compress the data then using the NSData writeToURL:@"Test.zip".
This method creates a compressed file that is the proper size but unable to be read/archived by any sources. I know this since I use the archive function in the finder and get a zip archive that can be archived.
So I have a feeling I am doing this incorrectly, so is there any other methods to zip folders? or is there another step before writing to file that I am missing?
Thanks
Edit: Added my code
NSFileWrapper *dirWrapper = [[NSFileWrapper alloc] initWithURL:url options:0 error:&tep];
NSData *dirData = [dirWrapper serializedRepresentation];
NSData *gzData = [dirData compressedDataUsingAlgorithm:NSDataCompressionAlgorithmZlib error:&tep];
[gzData writeToURL:Url2 atomically:YES];