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