• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSSavePanel: Hide extension is killing the extension
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSavePanel: Hide extension is killing the extension


  • Subject: Re: NSSavePanel: Hide extension is killing the extension
  • From: Eric Brunstad <email@hidden>
  • Date: Fri, 10 Jun 2005 17:17:30 -0400

Hi,

On Jun 10, 2005, at 10:03 AM, Theodore H. Smith wrote:


I've found something strange with the NSSavePanel. I've never used NSSavePanel before, mind you.

I open up a panel like this:

        [sp setCanSelectHiddenExtension:true];
        runResult = [sp runModalForDirectory:nil file: @"untitled.htm" ];

I click the "hide extension" checkbox in the save panel and the extension gets hidden. Then I uncheck the "hide extension" checkbox, and the extension stays hidden. In fact it appears to have been deleted.

What am I doing wrong? Or is this a bug in Cocoa?

What you are doing is wrong.

Do this instead:

[sp setAllowedFileTypes:[NSArray arrayWithObjects:@"htm",@"html"]];
[sp setCanSelectHiddenExtension:YES];
runResult = [sp runModalForDirectory:nil file:@"untitled.htm"];

The reason why you must do this is becuase Cocoa must know what extension to slap on the name when the checkbox is selected.

Eric Brunstad
Mind Sprockets Software
email@hidden
www.mindsprockets.com

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: NSSavePanel: Hide extension is killing the extension
      • From: Fritz Anderson <email@hidden>
References: 
 >NSSavePanel: Hide extension is killing the extension (From: "Theodore H. Smith" <email@hidden>)

  • Prev by Date: Re: Am I overreleasing something?
  • Next by Date: Re: Still can't figure out this overrelease bug
  • Previous by thread: NSSavePanel: Hide extension is killing the extension
  • Next by thread: Re: NSSavePanel: Hide extension is killing the extension
  • Index(es):
    • Date
    • Thread