Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective Zip problems getting started
    primarykey
    data
    text
    <p>I am trying to use objective zip (v1.01e) in an IOS4 application as I want the ability to send password protected zip files via email.</p> <p>I have got the objective zip source code files in my application, but am experiencing some problems following this getting started guide. <a href="http://code.google.com/p/objective-zip/wiki/GettingStarted" rel="nofollow">http://code.google.com/p/objective-zip/wiki/GettingStarted</a></p> <p>I use the following command</p> <pre><code>ZipFile *zipFile= [[ZipFile alloc] initWithFileName:@"yourFiles.zip" mode:ZipFileModeCreate]; </code></pre> <p>But this always fails returning null via the code shown below from method zipOpen2 (line 507). Here:</p> <pre><code>if (ziinit.filestream == NULL) return NULL; </code></pre> <p>Following the stack trace it passes though the following methods:</p> <pre><code>//First - (id) initWithFileName:(NSString *)fileName mode:(ZipFileMode)mode //Second extern zipFile ZEXPORT zipOpen (pathname, append) //Third extern zipFile ZEXPORT zipOpen2 (pathname, append, globalcomment, pzlib_filefunc_def) </code></pre> <p>However, I notice the second method has this code.</p> <pre><code>extern zipFile ZEXPORT zipOpen (pathname, append) const char *pathname; int append; { return zipOpen2(pathname,append,NULL,NULL); } </code></pre> <p>When I query the value of the string pathname (in GDB) from this method on I get:</p> <p>0x1b7f30 does not appear to point to a valid object.</p> <p>So my questions:</p> <ol> <li>What is <code>const char *pathname</code>, what does it do and is it messing up the pathname? AFAIK char is a single character which cant possibly represent a file name??</li> <li>The code shown comes from source code of the objective zip project and not my own so I assume its working. It may be my misunderstanding of it. So what other possible reasons could be causing this problem?</li> </ol> <p>For some more info <code>initWithFileName:</code> takes the parameter, filename and passes it on to <code>zipOpen()</code> by creating a pointer to file name as follows.</p> <pre><code>_fileName = [fileName retain]; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload