How can i use NSSavePanel to select a directory?
Asked Answered
A

1

16

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?

Adlee answered 3/8, 2010 at 11:38 Comment(1)
I also need this because given the new sandboxing rules, NSOpenPanel will return a folder in the app's containerDeste
D
29

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:.

Discussant answered 3/8, 2010 at 13:32 Comment(1)
Will Apple approve usage of open panel instead of save ? (I think I saw an app that opened and NSOpenPanel on save, but I am not sure it was app I downloaded from app storeGeneticist

© 2022 - 2024 — McMap. All rights reserved.