How can i use NSSavePanel to select a directory?

会有一股神秘感。 提交于 2019-12-21 07:23:32

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/3396081/how-can-i-use-nssavepanel-to-select-a-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!