Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to save a "." file using NSSavePanel without MacOS warning me?

Tags:

xcode

cocoa

I'm working on a cocoa project. My project uses a preferences menu, and includes the option to save a set of preferences as a "." file (hidden files like .rvmrc or .vimrc). The problem is that after bringing up the NSSavePanel and clicking Save the system pops up and reminds me that "." is reserved for the system, which isn't very cool.

Is there some way to prevent the OS from firing that prompt?

Thanks!

like image 447
Ziggy Avatar asked Jul 13 '11 02:07

Ziggy


1 Answers

You can subclass or make a category of NSSavePanel and override

-[NSSavePanel _legalNameCheck:]

AFAIK, checking for the dot name is all that routine does.

like image 93
Ken Aspeslagh Avatar answered Sep 24 '22 10:09

Ken Aspeslagh