Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 12, 2010, 02:34 AM   #1
yaniv92648
macrumors member
 
Join Date: Oct 2009
Unzip

Hi,
i have a url inwhich there's a zip file i wanna unzip. i tried zlib, gzip, NSDataCategory (the methods zlibInflate, gzipInflate) and more..
but without success. i would like please a simple example of converting a zip file (NSData *) to an unzipped file (NSData *).
Thank u very much.
yaniv92648 is offline   0 Reply With Quote
Old Jul 12, 2010, 02:55 AM   #2
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
What has failed about the approaches you have tried. Post the code that you have tried and explain in each case exactly what failed and where.
robbieduncan is offline   0 Reply With Quote
Old Jul 12, 2010, 03:26 AM   #3
yaniv92648
Thread Starter
macrumors member
 
Join Date: Oct 2009
Examples

NSData *zippedFile = [NSData dataWithContentsOfURL:[NSURL URLWithString:url]]; // works well

zippedFile size: 1543 Bytes

unZippedFile should be about 5.5 KB

i imported zlib, gzip, minizip, ZipArchive and NSDataCategory:

NSData *zippedGzipDeflate = [zippedFile gzipDeflate];
NSData *zippedGzipInflate = [zippedFile gzipInflate];
NSData *zippedZlibDeflate = [zippedFile zlibDeflate];
NSData *zippedZlibInflate = [zippedFile zlibInflate];

zippedGzipDeflate.length = 1566 Bytes
zippedGzipInflate.length = 0 Bytes
zippedZlibDeflate.length = 1554 Bytes
zippedZlibInflate.length = 0 Bytes

i also tried ZipArchive: UnzipFileTo, UnzipOpenFile.

http://stackoverflow.com/questions/412982/iphone-unzip

http://www.iphonedevsdk.com/forum/ip...mat-files.html

http://stackoverflow.com/questions/1...in-objective-c

http://forums.macrumors.com/showthread.php?t=750332

http://www.flyblog.info/catprogramming/202.html

http://www.iphonekicks.com/objective...p_format_files

i feel like it's right under my nose and i can't find how 2 do it...
yaniv92648 is offline   0 Reply With Quote
Old Jul 12, 2010, 03:38 AM   #4
TZRaceR6
Guest
 
Join Date: Jun 2010
Location: United Kingdom
I use a program called Stuffit. You can do a google search on it to find out about it. You have to pay for the full version, but there is a trial version for free.
TZRaceR6 is offline   0 Reply With Quote
Old Jul 12, 2010, 03:49 AM   #5
yaniv92648
Thread Starter
macrumors member
 
Join Date: Oct 2009
i don't understand u

i wanna do it programmatically through objective-c code
yaniv92648 is offline   0 Reply With Quote
Old Jul 12, 2010, 03:49 AM   #6
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
Quote:
Originally Posted by TZRaceR6 View Post
I use a program called Stuffit. You can do a google search on it to find out about it. You have to pay for the full version, but there is a trial version for free.
This is about iPhone Programming and programmatically unzipping a file. A Mac OS application is totally irrelevant.

Edit: Just as a test can you unzip the file correctly with the Mac OSX unzip in The Finder?
robbieduncan is offline   0 Reply With Quote
Old Jul 12, 2010, 03:52 AM   #7
yaniv92648
Thread Starter
macrumors member
 
Join Date: Oct 2009
Yes.

when i paste the url in the address bar it automatically downloads, unzips the file and open the unzipped file.
yaniv92648 is offline   0 Reply With Quote
Old Jul 12, 2010, 03:53 AM   #8
robbieduncan
Moderator
 
robbieduncan's Avatar
 
Join Date: Jul 2002
Location: London
OK, so it's unlikely to be a problem with the file itself. Are there any messages printed to the console? Do you have the source to the unzip methods you are using? If so step through in the debugger and check what's going on.
robbieduncan is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
unzipping ACE files? flat6 Mac Applications and Mac App Store 1 Jan 24, 2006 05:31 PM
what do I unzip .1, .2, .3, ... files with? flat6 Mac Applications and Mac App Store 5 Jan 11, 2006 06:12 AM
WoW Beta client of FilePlanet won't unzip Hackett Games 5 Nov 4, 2004 09:59 PM
unzipping files j_maddison Mac Applications and Mac App Store 7 Jun 1, 2004 09:07 AM
Unzipping .zips with passwords applemacdude General Mac Discussion 7 Sep 5, 2003 05:48 PM


All times are GMT -5. The time now is 09:43 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC