Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There's a now deprecated method in the NSSavePanel's delegate with a method name of:</p> <p><code>- (BOOL) panel: (id) sender shouldShowFilename: (NSString *) filename]</code></p> <p>which can be used to tell the save panel to <strong><em>not</em></strong> display certain filenames. </p> <p>Details about how to use it can be seen in <a href="https://developer.apple.com/library/mac/#qa/qa1468/_index.html" rel="nofollow noreferrer">this Apple QA technote</a>, which details how to do exactly the opposite of what you are trying to do (their example is how to choose any file but ignore packages, but you may be able to flip the internal logic around).</p> <p>Now, remember that I said that the method is "deprecated". The NSSavePanel header file says this:</p> <pre><code>/* This method is deprecated in 10.6, and will be formally deprecated */ /* in a future release. Use panel:shouldEnableURL: instead */ - (BOOL)panel:(id)sender shouldShowFilename:(NSString *)filename; </code></pre> <p>What NSOpenSavePanelDelegate's <a href="http://developer.apple.com/library/mac/documentation/Cocoa/Reference/NSOpenSavePanelDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/NSOpenSavePanelDelegate/panel:shouldEnableURL:" rel="nofollow noreferrer"><code>panel:shouldEnableURL:</code></a> apparently does it merely allow or disallow the file from being selectable. </p> <p>To future-proof your app, you may need to do the <a href="https://stackoverflow.com/questions/3697058/when-to-use-respondstoselector-in-objective-c"><code>respondsToSelector</code> trick</a> to make sure "<code>shouldShowFilename</code>" is still available as an option before using the less desirable "<code>shouldEnableURL</code>" method.</p>
    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.
    1. This table or related slice is empty.
    1. 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