Вопрос

is it possible for the NSOpenPanel to show files with certain predefined attributes only, while all others are faded out?

I would like to show files for example the have certain creation or modification dates.

Thanks a lot!

Это было полезно?

Решение

NSOpenPanel has a delegate protocol named NSOpenSavePanelDelegate.

And in there, you have the option of saying which files (returned as file URL's) are enabled. The one you'll want is "panel:shouldEnableURL:", which hands you a URL which you can open (within that delegate method) and look at the various file attributes such as creation or modification dates to decide which ones for which you can return YES ("yes", as in "yes this file can be selected for opening").

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top