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.
我想知道如何为文件对话框设置文件扩展名,以便只有具有该扩展名的文件才会显示在文件夹中。我知道有一种方法可以设置是否可以看到文件/目录,以及文件对话框查看的文件夹,但还没有找到设置文件扩展名的方法。有什么建议么?
使用 NSOpenPanel/NSSavePanel 方法setAllowedFileTypes:。OS X 考虑文件类型,而不是扩展名。
setAllowedFileTypes: