允许NSOpenPanel中除了一个以外的所有文件类型 [英] Allow all files type except one in NSOpenPanel

查看:171
本文介绍了允许NSOpenPanel中除了一个以外的所有文件类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序创建一个新类型(扩展名)的文件,让我们说它的.newtype,所以当我想用NSOpenPanel浏览文件来创建它,这种类型的文件必须是不可选的。



如何将除.newtype之外的所有文件类型传递给NSOpenPanel实例?

解决方案<提供一个委托来处理 NSOpenSavePanelDelegate protocol panel:shouldEnableURL: 方法


my application create a "new" type (extension) of file, let say its ".newtype", so when i want to browse files with NSOpenPanel to create it, this type of files have to be not selectable.

how can i pass ALL files type except ".newtype" to the NSOpenPanel instance ?

解决方案

Provide a delegate that handles the NSOpenSavePanelDelegate protocol panel:shouldEnableURL: method.

这篇关于允许NSOpenPanel中除了一个以外的所有文件类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆