Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's nothing wrong with that code. Actually, there are a number of things that are less than ideal about that code, but nothing that will make it not work. What does the decompresss2z: function look like? </p> <p>If this were my code, I'd make the following changes:</p> <ol> <li><code>runModalForDirectory:file:</code> is deprecated; you should use <code>runModal</code> instead.</li> <li><code>filenames</code> is deprecated; you should use <code>URLs</code> instead (you can call <code>path</code> on each URL to get the filename).</li> <li><code>NSLog</code>'s parameter needs to be a format string, or else odd things can happen.</li> <li>You should use fast enumeration (with the <code>in</code> keyword), rather than looping through a container with an index. It's not only more efficient, it's less code (and less code is better).</li> <li>There's no reason to call <code>performSelector:withObject:</code> here; just call the method normally.</li> </ol> <p>Rewritten, it would look like this:</p> <pre><code>NSOpenPanel* openDlg = [NSOpenPanel openPanel]; [openDlg setCanChooseFiles:YES]; [openDlg setCanChooseDirectories:YES]; if ( [openDlg runModal] == NSOKButton ) // See #1 { for( NSURL* URL in [openDlg URLs] ) // See #2, #4 { NSLog( @"%@", [URL path] ); // See #3 [self decompresss2z:[URL path]]; // See #5 } } </code></pre> <p>Again, though, none of these changes will change your actual issue. In order to help further, we need to see more code. Specifically, I'd like to see what decompressss2z: looks like.</p>
    singulars
    1. This table or related slice is empty.
    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.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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