IPhone SDK - adding compressed content to resources, and then unpacking to the Documents folder

I have some resources (zipped) that need to be sent with my iphone application. When the application is launched for the first time, this zipped file must be moved / copied to the Documents folder and unzipped there. The user can then add additional files from the application to this file. Can someone please suggest how can I achieve this?

Thanks!

+5
source share
3 answers

Based on your comment above:

, , . , . -, . zipping unzipping .

. , - , "". ( , ). , zip tar, .

, Xcode, , . , , .

EDIT:

, , , , , , "", :

[[NSFileManager defaultManager] copyItemAtPath:(NSString *)srcPath toPath:(NSString *)dstPath error:(NSError **)error];

. !

+6

libz.dylib Framework Deusty NSData gzip category, /.

+4

While this is available using libz.dylib, it really is not necessary, as it saves little (if any). When the application is transferred to the phone, the application package is already compressed. Compression over compression usually gives a little extra compression.

Try it yourself. You may find that delivering your application with unpacked content may take up as much space as compressed content.

+3
source

All Articles