15

I need the user select an existing or a new directory where my app can save a few files.

Can i do this with NSSavePanel or is there another directory selector class?

Lothar
  • 12,537
  • 6
  • 72
  • 121
  • I also need this because given the new sandboxing rules, NSOpenPanel will return a folder in the app's container – simon.d Sep 12 '12 at 21:14

1 Answers1

28

NSSavePanel doesn't give the ability to choose folders but NSOpenPanel (a subclass of NSSavePanel) does. You set YES for -setCanChooseDirectories: and -setCanCreateDirectories:, set a prompt that makes sense with -setPrompt:.

Joshua Nozzi
  • 60,946
  • 14
  • 140
  • 135