Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
因此 NSSavePanel 当前返回一个带有扩展名的文件 url,并且您的应用程序有权写入该文件。
有没有办法让用户选择要写入的目录?例如,如果应用程序一次导出十几个图像,则用户不会提前指定名称。
你需要 NSOpenPanel。
NSOpenPanel * openPanel = [NSOpenPanel openPanel]; [openPanel setCanChooseFiles:NO]; [openPanel setCanChooseDirectories:YES]; [openPanel setAllowsMultipleSelection:NO];