Re: NSSavePanel: Hide extension is killing the extension
Re: NSSavePanel: Hide extension is killing the extension
- Subject: Re: NSSavePanel: Hide extension is killing the extension
- From: "Theodore H. Smith" <email@hidden>
- Date: Sat, 11 Jun 2005 23:29:52 +0100
From: Eric Brunstad
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.
Hi Eric,
What I am trying to do, is provide a default file extension, but
allow them to change the extension as they like. For HTML, this isn't
so bad, because there are a variety of html extensions
(.html, .htm, .shtml, etc). Sometimes HTML comes with no file
extension, even.
For example "MyHTMLFileName" and "MyHTMLFileName.html" are both
perfectly valid HTML file names.
Should I just forget the whole filetypes thing in such a case, and
just specify a filetype of nil, and also not even allow them to hide
the extension?
--
http://elfdata.com/plugin/ Industrial strength string processing,
made easy.
"All things are logical. Putting free-will in the slot for premises in
a logical system, makes all of life both understandable, and free."
_______________________________________________
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